85fdafbe12905e012128b7fc65c79a8644547e44
By:
SReach

How do i make my discord bot run 24/7?

October 29, 2016 209 views
DigitalOcean Node.js

When i close the terminal the bot closes how do i make it not close, So it can run all night all day.

1 Answer
xMudrii October 29, 2016
Accepted Answer

You need some node module that would allow to run it forever.

I can recommend you two - pm2 or forever. I'm more on side of pm2 as it have better process management. Also there are tutorials on DO for setting it up.

Follow PM2 part of Set Up Node.js App for Production. It'll show you how to make it run always and as a service (e.g. automatically run it when servers reboot or after power on)

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.
Have another answer? Share your knowledge.