Hosting on Debian

Here you will learn how to start your bot made with Scratch For Discord using Debian.

Following this tutorial implies that you have some basic knowledge about Debian like how to connect your VPS and uploading files (using FTP for example).

Install Node.js

You will need Node.js to run your bot on a Debian server. To install it, run the following commands (in the right order):

apt-get install curl software-properties-common
curl -sL https://deb.nodesource.com/setup_12.x | sudo bash -
sudo apt-get install nodejs

Install PM2

Run the command below to install pm2 a process manager that will keep your bot online... forever:

npm install -g pm2

Upload your code

You will need to export your bot to code on ScratchForDiscord. Click on the "download" button, shown below:

You will get a .zip file. Unzip it and upload it to your server using FTP or SFTP.

Install dependencies

Use the cd command to go to your uploaded directory. Once you are in the right folder, run the following commands, in the right order:

npm install --save discord.js@12.2.0
npm install --save easy-json-database

Start your bot!

Run the following command:

pm2 start bot.js

And your bot will be online! If you want to get the bot's logs, you can run the following command:

pm2 logs bot.js

Last updated