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

Become a contributor for community

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

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.