Linux installation (and VPS)
This page will guide you through the process of hosting the bot on your Linux server.
Last updated
Was this helpful?
This page will guide you through the process of hosting the bot on your Linux server.
Last updated
Was this helpful?
Please, note that this procedure should work on Debian based Linux distros, other distros may use different commands to install certain things. I am going to use Hetzner VPS with their preinstalled version of Debian 11 for this guide.
Log in into your account on Hetzner Cloud ()
Create a project and click CREATE A SERVER
Select a region that is closest to you, Debian 11 as an OS. Server type can be the cheapest one, all the packages have a lot more power than the bot needs.
Give your server a name, than order the VPS by clicking CREATE & BUY NOW and wait a few minutes for the server to get ready
Open your e-mail. In your mail inbox, you should have server SSH login details from Hetzner.
Open your SSH client (you can also use command promt/terminal, if you are on Windows), connect to the server using:
ssh root@your-ip-adress
and use the password from the mail.
Change your password, it should automatically promt you. If not, you can do so with passwd
command
Once you are there, update all packages using
apt update & apt upgrade -y
Next we are going to install Python 3 and all packages the bot depends on.
Use this to install Python 3 and pip
apt install python3 python3-pip -y
Install python packages the bot depends on with
pip3 install -U discord.py mysql-connector-python pyyaml
Install MariaDB package
Start and enable it
Go through the guided initial setup
Open MySQL console
Create new admin user. The password is up to you.
Grant the account all permissions including ability to create more users.
Apply the changes.
To quit, type
Download zipped phpMyAdminFiles
Create a configuration file based on phpMyAdmin exapmle
Create a temporary storage
Now open the configuration file
Edit line with $cfg[‘blowfish_secret’] = ‘
your-key
‘;
You should replace this with 32 character long secret phrase
At the end of the config insert new line
After all, this, Save the file by pressing Ctrl+O, hit the Enter key, and then Ctrl+X to exit.
Change file permissions to allow webserver to access these files
Create Apache config file
Paste this configuration inside the file
Save the file by pressing Ctrl+O, hit the Enter key, and then Ctrl+X to exit.
Activate the configuration
Restart the webserver
Done! Access the web interface using http://your-server-ip/phpmyadmin
Create a folder for our bot, to make things more organised
mkdir /FoxCodeBot
cd /FoxCodeBot
Log in to your server and navigate to FoxCodeBot directory
Open the config.yml and insert your bot token and database credentials
Install pm2 using these commands:
apt install npm -y
npm i -g pm2
Make sure you are in the bot folder
Run following commands
npm i pm2 -g
npm i
Run the bot using the command bellow, you can choose your own name
pm2 start main.py --name FoxCodeBot --interpreter python3
Check the log to make sure, that everything is running without errors
pm2 logs FoxCodeBot
Done, you should be good to go! Now you can move on to Modules installation!
Login using the database account we created earlier. You can now easily manage your databases, create and delete new ones.
To make things easier, connect to your server with files manager. You can do that with any FTP/SCP client, I am used to WinSCP:
Upload the unzipped bot files you downloaded to the folder
If you have any issues during the installation, feel free to join our Discord server and ask for help there!