Node.js hosting on your own VPS
A Node.js app needs a machine that stays on. Free platforms sleep after a few minutes without traffic, and serverless functions stop after a time limit, which breaks bots and WebSockets. On a natbox server your process runs all the time, on the Node version you pick, from $1.00 a month or free for your first month.
Try it free for a month · Order Nano
Which plan
| Plan | RAM | Good for | Price |
|---|---|---|---|
| Nano | 512 MB | Bots, Express or Fastify APIs, WebSocket servers | $1.00 a month |
| Box | 1 GB | Next.js or Nuxt sites, an app plus its database | $1.25 a month |
| Box Plus | 2 GB | Building big front ends on the server, several apps | $2.25 a month |
A small Node.js API uses 50 to 120 MB. Building a large Next.js project can briefly need more than 1 GB; if your plan has less, build on your computer or in CI and copy the output to the server.
How to set it up
- Install Node.js from the NodeSource packages or with
nvm, so you get a current LTS version. - Copy your code with git or rsync and run
npm ci --omit=dev. - Keep it running with a systemd service (or pm2). Both restart the app after a crash and at boot.
- Let it listen on one of your ports, or put Caddy in front on 443 and link your domain in the client area for HTTPS.
Guides: run an app as a service, nginx reverse proxy, automatic HTTPS with Caddy, Discord bot.
Good to know
- No Docker, as the server is a container itself. Run Node directly; it also saves memory.
- Ports: your app can use any of your forwarded ports on IPv4 (TCP and UDP), every port on your IPv6, and 80/443 for your linked domains.
- Outgoing mail ports are closed. Use an email API (Resend, Postmark, Mailgun) over HTTPS from Node.
Node.js hosting questions
Can I host a Next.js app?
Yes, with next start or the standalone output behind Caddy or nginx. Use Box or bigger, or build somewhere else and only run it on the server.
Do WebSockets work?
Yes, on your own ports, and through your domain on 443: HTTPS is passed to your server untouched, so WebSocket upgrades work as usual.
pm2 or systemd?
Either. systemd needs nothing extra; pm2 is handy if you already use it. Our guides use systemd.
Can I use Bun or Deno?
Yes. Both install as a single binary and run the same way.
Also see: Python hosting, Discord bot hosting, cheap VPS plans.