DEV Community

Cover image for How to Host a discord bot🤖 24/7 in a Ubuntu Server
Raghav Mrituanjaya
Raghav Mrituanjaya

Posted on Edited on Originally published at thegogamicblog.xyz

How to Host a discord bot🤖 24/7 in a Ubuntu Server

Hello, In this post we will be seeing how to host a discord.py bot 24/7 on a ubuntu server. This post assumes that you have already coded your discord bot.

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

  1. SSH into your server using putty or any other you prefer

  2. Run sudo apt-get install supervisor to install supervisor-ctl

  3. Then Run This command to make a new config sudo nano /etc/supervisor/conf.d/yourproject.conf

  4. Then type the following

  5. Run sudo supervisorctl restart all to restart the service with new configuration

  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

P.S:- Vultr(Get a $100 credit by registering using this link) is a good hosting choice if you're looking for one

Top comments (4)

Collapse
 
swapnil_bhagat profile image
Swapnil Bhagat •

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

Collapse
 
raghavmri profile image
Raghav Mrituanjaya •

I'm sorry will modify it

Collapse
 
mutim profile image
Mutim •

This is incomplete. At step 4, you instruct readers to type the following, but there's nothing there to type.

Collapse
 
mutim profile image
Mutim •

This is incomplete. At step 4, you instruct readers to type the following, but there's nothing there to type.