Managing and Deploying Your Service with HostingUp
Quick Start Guide: Deploy Your Bot with HostingUp
Note: The following instructions assume your repository’s start command is not python bot.py
, python main.py
, python3 bot.py
, or python3 main.py
.
Method: Simple Commands for Quick Setup
For a streamlined setup based on your Procfile configuration:
To Start Your Bot:
Use the following command:
hall <REPO_URL> [BOT_SCRIPT] [RUN_COMMAND] [SERVICE_NAME] [BRANCH_NAME]
Example:
hall https://github.com/example/repo.git bot.py "python3 bot.py --option" my-custom-service my-branch
<REPO_URL>
: URL of your GitHub repository.[BOT_SCRIPT]
(optional): Python script to run (default isbot.py
).[RUN_COMMAND]
(optional): Command to execute the bot (default ispython <BOT_SCRIPT>
). Enclose in quotes if it contains spaces.[SERVICE_NAME]
(optional): Name of the systemd service (default isbotpy
).[BRANCH_NAME]
(optional): Branch name to checkout.
To Stop Your Bot:
hcloseall <REPO_NAME>
Benefits:
- Automatic Server Setup: Simplifies the initial configuration.
- Continuous 24/7 Operation: Ensures your bot runs without interruption.
- Automatic Restarts: Bot restarts automatically after server reboots.
Managing and Monitoring Your Service
Re-deploying Bot with Changes
If you need to re-deploy the bot with some changes, follow these steps:
- Commit Changes to GitHub: Ensure that you have committed your changes to your GitHub repository. Changes made directly on the VPS will not be reflected unless they are pushed to your GitHub account.
- Run the Deployment Command: On the VPS, use the script with the following command:
hall <GitHub Repo URL> [BOT_SCRIPT] [RUN_COMMAND] [SERVICE_NAME] [BRANCH_NAME]
This command will pull the latest changes from your GitHub repository and redeploy the bot with those updates.
By following these steps, the changes will be reflected, and the bot will be restarted with the updated code.
Checking Service Status
View the Status of Your Service:
sudo systemctl status <REPO_NAME>.service
View Detailed Service Logs:
sudo journalctl -u <REPO_NAME>.service
View Logs from the Past Hour:
sudo journalctl -u <REPO_NAME>.service --since "1 hour ago"
Follow Real-Time Logs:
sudo journalctl -u <REPO_NAME>.service -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 benefit from HostingUp.
Watch Our Tutorial
For a visual guide, check out our YouTube tutorial: