Question

How to make your Discord bot online 24/7.

Posted October 6, 2020 14.1k views
Node.jsJavaJavaScript

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?

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.

×
Submit an Answer
3 answers

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

by Brennen Bearnes
Node.js is an open source JavaScript runtime environment for easily building server-side and networking applications. Node.js applications can be run at the command line but this guide focuses on running them as a service using PM2, so that they will automatically restart on reboot or failure, and can safely be used in a production environment.

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?