24/7/365 support support@nullstrata.space
Client login →

← All guides

Guide · 8 min read

Running a Node.js app on shared hosting: what works and what doesn't

How to prepare a Node.js app for a managed hosting platform, use Redis and PostgreSQL, and know when it is time for a VPS.

Updated Sep 30, 2026 · by the Nullstrata team

Node.js used to mean “rent a VPS and manage it yourself”. Today, a managed hosting platform can run many Node.js apps just fine, and you skip patching servers yourself. Here is what works well on shared hosting, how to prepare your app, and the honest limits.

What runs well on shared hosting

  • APIs and back ends for websites and mobile apps with moderate traffic.
  • Server-rendered sites (for example Next.js, Nuxt or Express with a template engine).
  • Webhooks, bots and small automations that react to events.
  • Side projects and MVPs where cost and zero server admin matter most.

Prepare your app

  1. One clear entry file. Make sure package.json has a start script, e.g. "start": "node server.js".
  2. Listen on the port you are given. Use const port = process.env.PORT || 3000; rather than a fixed number.
  3. Configuration via environment variables. Keep secrets (database passwords, API keys) out of your repository and load them from the environment or a .env file that is not committed.
  4. Production install. Install with npm ci --omit=dev to keep the deployment lean.
  5. Build before you start. For frameworks with a build step, run the build during deployment, not on every start.

Deploying

With SSH access you can pull your code with Git and install dependencies on the server, or upload a built package. In the control panel, enable Node.js for your site and point it at your entry file. The exact labels vary between control panels, but the pieces are always the same: where your code lives, which file starts it and which domain or path it answers on.

Databases and caching

Our hosting platform offers both MySQL/MariaDB and PostgreSQL, plus Redis and Memcached. A common, efficient setup:

  • PostgreSQL or MySQL as the source of truth.
  • Redis for sessions, rate limiting and caching expensive queries.
  • Varnish in front of pages that rarely change, where available.

Check the Node.js hosting page for which of these each plan includes or offers as an add-on.

Keeping it running

Apps crash, the question is what happens next. Use the platform's process management (for example Supervisor instances, where your plan includes them) so the app restarts automatically, and write logs to files you can read over SSH. Add a simple health-check route such as /health so you can tell at a glance whether the app is up.

The honest limits

Shared platforms balance resources between many customers, so there are CPU and memory limits. That makes them a poor fit for CPU-heavy work (video encoding, large data processing), very high sustained traffic, or anything that needs root access and custom system packages. When you hit those limits, the next layer is a KVM VPS, same account, same support, full control.

Frequently asked

Can I run Node.js on shared hosting?

On our platform, yes, Node.js is available as an option on hosting plans, alongside SSH, Redis, Memcached and PostgreSQL. It is well suited to small and medium apps, APIs and server-rendered sites.

Which port should my app listen on?

Do not hard-code a port. Read it from the environment (for example process.env.PORT) and fall back to a default only for local development, the platform tells your app where to listen.

When do I need a VPS instead?

When you need root access, a specific system package or Node.js version the platform does not offer, Docker, or heavy long-running background workers.