SELF HOST
HOW TO HOST CATUSERBOT ON YOUR OWN?
1. First of all, update and upgrade apt :
sudo apt update && sudo apt upgrade -y
2. And then install the required apt packages:
sudo apt install --no-install-recommends -y curl git libffi-dev libjpeg-dev libwebp-dev python3-lxml python3-psycopg2 libpq-dev libcurl4-openssl-dev libxml2-dev libxslt1-dev python3-pip python3-sqlalchemy openssl wget python3 python3-dev libreadline-dev libyaml-dev gcc zlib1g ffmpeg libssl-dev libgconf-2-4 libxi6 unzip libopus0 libopus-dev python3-venv libmagickwand-dev pv tree mediainfo
If you wanna use local database then follow this steps else skip to step 8
Install requirements for this by
sudo apt install postgresql postgresql-contrib
3. Change the user to postgres to change the default ident password:
sudo su - postgres
4. And then open the PostgreSQL shell:
psql
5. Set any password you prefer, by running the below SQL:
ALTER USER postgres WITH PASSWORD 'yourpasswordhere';
6. Get out of the PostgreSQL shell:
\q
7. And go back to your user:
exit
Now, the DB_URI will be:
postgresql://postgres:[email protected]:5432/catuserbot
or use elephantsql if you wanna use that
8. Clone the repository:for goodcat
git clone https://github.com/sandy1709/catuserbot
for badcat
git clone https://github.com/jisan09/catuserbot
9. Change dir to the cloned folder:
cd catuserbot
10. Create your config.py.
by renaming the exampleconfig.py
mv exampleconfig.py config.py
you can get string session by running python3 stringsetup.py
before running that install telethon by pip3 install telethon
11. Create a new screen:
Either tmux or screenfor screen
sudo apt install screen
screen -S catuserbotfor tmux
sudo apt install tmux
tmux
12. And a virtual environment:
virtualenv venv
13. Activate the virtual environment you've just created:
source venv/bin/activate
14. And install the Python requirements:
pip3 install -r requirements.txt
15. Finally, run the userbot:
python3 -m userbot
16. And get out of your screen
by pressing CTRL+A and after that CTRL+D. (if you used screen)
or
CTRL+B and then D (if you use tmux)
Last modified 9mo ago
Copy link