Hosting more than one Node.JS bot on a single droplet

February 11, 2018 135 views
Node.js Ubuntu

Hello, I am fairly new to this hosting business. I am currently making Discord and Twitter bots using Node.JS. I have one that uses a mongo database and one that will use SQLite. They each have their own accounts. My question is, will I be able to run them both at the same time on a single droplet? Or will I need to get two droplets?

2 Answers

Yes, you can run multiple Node.JS applications on single Droplet. You just need to make sure they're not running on the same port, but as long as they aren't, you can.

For that, you can use something such as pm2, to easily manage applications. Check out the How To Set Up a Node.js Application for Production on Ubuntu 16.04 to learn how to use pm2 to manage your applications.

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.