Hosting your Bot using a VPS

Hosting your ModMail with a VPS is the best option for stability and performance reasons.

Image from LowEndBoxopen in new window

  • Go to the directory you would like to install your ModMail.
  • Clone your repo with the URL you copied from GitHub when you forked the main one.
git clone <your URL>
cd ModMail
1
2
  • Install the dependencies and PM2.
npm install
npm install -g pm2
1
2
  • Create a file named .env and copy the content from the .env.template file and fill the variables.
    • BOT_TOKEN: your Discord Bot Token. You can find it in the Bot Tab of the Discord's Developer Portalopen in new window.
    • MAIN_GUILD_ID: the ID of the server where the treads will be opened. If you do not know how to get an ID, check this guideopen in new window.
    • MONGO_URI: the mongo URL you copied with the password replaced.
    • LOGS_URL: the URL where your logs will be hosted (make sure it ends in /). If you are not using any logs, just delete the line.
BOT_TOKEN=
MAIN_GUILD_ID=
MONGO_URI=
LOGS_URL=
1
2
3
4
  • Start the bot with the following commands.
npm run build
pm2 start prod/index.js --name modmail
1
2

Once done, go to any channel on your server and run the command: +setup.


Success

Your bot should already be online.