Managing and Deploying Your Service with HostingUp
Quick Start: Deploy Your Bot with Ease
Note: The following instructions assume your repository's start command is either python bot.py
or python3 bot.py
.
Method: Simple Commands for Quick Setup
For a streamlined setup, follow these steps based on your Procfile configuration. This method is ideal for new VPS users with the latest setup. Existing VPS users might need to reinstall the OS to use these commands.
If Your Procfile Uses bot.py
To Start Your Bot:
hbot <your-repo-url>
Example:
hbot https://github.com/your-username/your-repo.git
To Stop Your Bot:
hcloseb {REPO_NAME}
Example:
hcloseb myfilterbot
Instructions:
- Replace
https://github.com/your-username/your-repo.git
with your actual repository URL. - Choose the command based on your Procfile configuration.
Benefits:
- Automatic Server Setup: Easily set up your bot with minimal configuration.
- Continuous 24/7 Operation: Ensure your bot runs continuously.
- Automatic Restarts: Your bot will restart automatically after server reboots.
Managing and Monitoring Your Service
Once your service is running, you can manage and monitor it using systemd
commands.
Re-deploying Bot with Changes
If you need to redeploy the bot after making changes, follow these steps:
- Commit Changes to GitHub: Ensure changes are committed to your GitHub repository. Changes made directly on the VPS will not be reflected unless pushed to GitHub.
- Run the Deployment Command:
hbot <GitHub Repo URL>
This command will pull the latest changes from your GitHub repository and redeploy the bot with those updates.
Checking Service Status
View the Status of Your Service:
sudo systemctl status {REPO_NAME}.service
This command displays whether the service is running, stopped, or has failed.
View Detailed Service Logs:
sudo journalctl -u {REPO_NAME}.service
Useful for troubleshooting and viewing detailed log output.
View Logs from the Past Hour:
sudo journalctl -u {REPO_NAME}.service --since "1 hour ago"
Filters logs to show entries from the past hour.
Follow Real-Time Logs:
sudo journalctl -u {REPO_NAME}.service -f
Shows log output in real-time, similar to tail -f
.
Managing the Service
Start the Service:
sudo systemctl start {REPO_NAME}.service
Stop the Service:
sudo systemctl stop {REPO_NAME}.service
Restart the Service:
sudo systemctl restart {REPO_NAME}.service
Reload the Service Configuration:
sudo systemctl reload {REPO_NAME}.service
Enable the Service to Start on Boot:
sudo systemctl enable {REPO_NAME}.service
Disable the Service from Starting on Boot:
sudo systemctl disable {REPO_NAME}.service
Note: Replace {REPO_NAME}
with your actual repository folder name (e.g., myfilterbot
). For example, to view logs, the command would be:
sudo journalctl -u myfilterbot.service
Need Help?
If you encounter any issues or need further assistance, please contact our support team:
- Email: [email protected]
- Phone: +91 01169652705
Explore our affiliate program to learn how you can earn with HostingUp.
Watch Our Tutorial
For a visual guide, check out our YouTube tutorial: