DEV Community

Cover image for How to Host a discord bot 24/7 in a VPS server

How to Host a discord bot 24/7 in a VPS server

gogamic profile image Raghav Mrituanjaya Updated on ・1 min read

Hi Guys so today in this post we will be seeing how to host a bot 24/7 in a ubuntu server

disclaimer: I think you have already have a or discord.js bot if you don't have then please refer this

These are the simple steps to keep running your bot 24/7

  1. SSH into your server using putty or any tool that you like
  2. run this code to install supervisor

    sudo apt-get install supervisor

  3. Then Run This command to make a new config

    sudo nano /etc/supervisor/conf.d/yourproject.conf

  4. Then type the following

  5. then run the following commands

    sudo supervisorctl restart all

  6. That's it now you can see your bot online 24/7 and even if you restart your server your bot will restart and come online

Some important notes

  1. the place where I have mentioned your project or project please change it to your desired name

  2. Also please change the following to according to your name

    • directory
    • stderr_logfile
    • stdout_logfile
    • user
  3. If you are looking a cheap and best place to host your bot consider Digital Ocean here is a link to their website

Do Support me on Patreon =>

Discussion (2)

Editor guide
swapnil_bhagat profile image
Swapnil Bhagat

Was that disclaimer supposed to have a link??
Also few typos. . .

gogamic profile image
Raghav Mrituanjaya Author

I'm sorry will modify it