How To Host Filter Bot Print

  • Filter Bot, Telegram Bot
  • 1

Setting Up and Running Your Python Filter Bot on a HostingUp VPS

  1. Access Your VPS:

    • Check your email for SSH access information.
    • If you do not receive it, raise a support ticket or join the Telegram support group.
  2. Update Your VPS Server:

    • Run the following commands to update your server:
      sudo apt update sudo apt upgrade
  3. Install Python3 and pip:

    • Install Python3 and pip using the command:
      sudo apt install python3-pip
  4. Clone Your Repository:

    • Clone your repository to your VPS:
      git clone YOUR-REPO-URL
    • Replace YOUR-REPO-URL with the actual URL of your repository.
  5. Navigate to Your Repository Folder:

    • Change into your repository directory:
      cd YOUR-FOLDER-NAME
    • Replace YOUR-FOLDER-NAME with the name of your cloned repository folder.
  6. Set Up a Virtual Environment (for Ubuntu 24):

    • Install the python3-virtualenv package:
      sudo apt install python3-virtualenv
    • Create a virtual environment named env:
      virtualenv env
    • Activate the virtual environment:
      source env/bin/activate
  7. Install Required Python Packages:

    • Install the dependencies listed in your requirements.txt file:
      pip3 install -r requirements.txt
  8. Run Your Bot 24/7:

    • Start your bot in the background using nohup:

      nohup python3 bot.py
    • Your bot is now running.

  9. How to Close the Bot:

    • To stop the bot, first find the PID (Process ID) of the running bot:
      ps -ef | grep python3
    • Locate the PID of the python3 bot.py process and then kill it:
      kill -9 PID
    • Replace PID with the actual Process ID of your bot.
  10. Additional Resources:

Automatically Set Up Your Server and Deploy Your Bot Running 24/7 with a Single Command

To streamline the deployment of your bot using a single command, choose the appropriate deployment script based on your procfile configuration:

  1. For python bot.py or python3 bot.py:

    Use the following command:

     
    curl -sL https://script.hostingup.in/python_bot_py.sh | sed 's/\r$//' | bash -s -- https://github.com/your-username/your-repo.git
    • Replace https://github.com/your-username/your-repo.git with your actual GitHub repository URL.
    • This command downloads and executes the python_bot_py.sh script, suitable for repositories configured to run bot.py.
  2. For python main.py or python3 main.py:

    Use this alternative command:

     
    curl -sL https://script.hostingup.in/python_main_py.sh | sed 's/\r$//' | bash -s -- https://github.com/your-username/your-repo.git
    • Replace https://github.com/your-username/your-repo.git with the URL of your GitHub repository.
    • This command utilizes the python_main_py.sh script, intended for repositories that execute main.py.

Stop Your Bot

For bot.py or python3 bot.py:

curl -sL https://script.hostingup.in/close_botpy.sh | sed 's/\r$//' | bash

For main.py or python3 main.py:

curl -sL https://script.hostingup.in/close_mainpy.sh | sed 's/\r$//' | bash

Important Notes:

  • Ensure you use the correct script (python_bot_py.sh or python_main_py.sh) based on the script specified in your procfile.
  • Double-check that your GitHub repository URL is correct to facilitate smooth deployment.

By following these instructions, you can deploy your bot efficiently with a single command tailored to your configuration.


Was this answer helpful?
Back