Question

How to make your Discord bot online 24/7.

So I made a discord bot, and I’m trying to make it so it stays online all day, and all night. I installed pm2 but when I log off my computer the bot goes back offline. Is there any way to make the bot online 24/7 without needing to have your computer on all day?


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
October 7, 2020
Accepted Answer

Hi there @edugutierrez2007,

Yes indeed, you will have to use pm2 in order to configure your application so that it runs 24/7.

Note that after installing pm2 you need to do some configuration in order to make it work. You can follow the steps here on how to configure your pm2 and your application:

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04#manage-application-with-pm2

Also, as a side note here is also a quick video on how to deploy Node.js with PM2, Nginx as a reverse proxy, and Cloudflare for SSL termination:

Regards, Bobby

The solution to your problem is the Cloud. Cloud is just a remote computer which runs your bot 24/7. There are tons of services available for remote hosting. I will advise you to use heroku because it’s free and when you get some experience in cloud hosting, you can buy better dedicated VPS by spending some money.

man I don’t understand your way

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel