Order Node.js + PM2 from the Marketplace App tab as shown in how to order a VPS with a one-click app. When the install card on your server page shows the finished result, follow the steps below.
What you get
The current LTS release of Node.js, npm and PM2, a process manager that keeps apps running. It needs 1 GB of memory and takes 2 to 5 minutes. The server page shows the versions.
1. Check it
Connect with SSH:
node -v
npm -v
pm2 -v
2. Run your app
Upload your project, install what it needs and start it with PM2:
cd ~/myapp
npm install
pm2 start server.js --name myapp
pm2 save
pm2 startup
pm2 startup prints one more command; run that, and your app starts again after a reboot.
3. Put it on a domain
The full walk-through is in host a Node.js app on a VPS, which covers Nginx as a reverse proxy. Add HTTPS with Certbot.
Next steps
- Connect to your VPS with SSH to run the commands above.
- Secure your new VPS before you put real data on it.
- Something not working? See what happens after you order an app, or open a ticket from Support.