📕Self Host

≡ Build your bot manually

Hosting bot manually can be a bit of pain, that why we prefer Docker over it. Anyways If want to host manually keep up with these 2 pointers: Chrome, Venv

Install required packages

Update and install apt packages & node.v18
sudo apt update && sudo apt upgrade -y \
&& sudo apt install --no-install-recommends -y ca-certificates curl ffmpeg fonts-noto-color-emoji gcc git gnupg libmagickwand-dev libpq-dev mediainfo nano neofetch pv python3 python3-dev python3-lxml python3-pip python3-psycopg2 screen tree unzip virtualenv wget zlib1g libyaml-dev \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && NODE_MAJOR=18 && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list && \
sudo apt-get update && sudo apt-get install nodejs -y

Clone the repo & make config

Change dir to catuserbot & make config.py to save config values
git clone https://github.com/TgCatUB/catuserbot && cd catuserbot && mv exampleconfig.py config.py

Setup Chromium & its driver

Edit the config.py with your config values

  • Modify the config.py with any text editor, like nano config.py

Create a Virtual environment & install requirements

Create catuserbot screen session
screen -S catuserbot
Install venv & requirements
virtualenv venv && source venv/bin/activate && pip3 install -r requirements.txt

All setup completed, its time to run the bot.

  • Run: python3 -m userbot

  • Close Screen: Press CTRL+A and after that CTRL+D

  • Check: screen -ls

  • Reattach Screen: screen -r <some_id>.catuserbot

Video Tutorial

Last updated