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.

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

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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

Same. I create a discord bot. When I put my in a server, I see it is ofline. I tried to make it online but I can’t. I download pm2 but when I turn off my computer it went offline.Is there any other way to make my bot work forever?