natbox.io

Node.js hosting on your own VPS

Express and Fastify APIs, Next.js sites and bots, running 24/7 on a Linux server where you have root.

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

PlanRAMGood forPrice
Nano512 MBBots, Express or Fastify APIs, WebSocket servers$1.00 a month
Box1 GBNext.js or Nuxt sites, an app plus its database$1.25 a month
Box Plus2 GBBuilding 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

  1. Install Node.js from the NodeSource packages or with nvm, so you get a current LTS version.
  2. Copy your code with git or rsync and run npm ci --omit=dev.
  3. Keep it running with a systemd service (or pm2). Both restart the app after a crash and at boot.
  4. 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

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.