NewOut Plane raises funding, backed by Maza VenturesRead the announcement
Back to Blog
Guide

Node.js Hosting in 2026: Git-Push Deploys and Managed Postgres

Recep Erdoğan••18 min read
Node.js Hosting in 2026: Git-Push Deploys and Managed Postgres

Node.js hosting has moved well past renting a bare server and configuring it by hand. In 2026 the practical question is not where can I put a Node process, but which platform gives me a git-push deploy, a managed database, HTTPS, and a bill I can predict, without asking me to run my own infrastructure.

This guide covers what to look for in Node.js hosting, how modern deploys actually work, and how to run an Express, NestJS, or Next.js application in production, including what it costs once real traffic arrives.

The short answer: for most teams in 2026, the best Node.js hosting is a platform-as-a-service that deploys straight from GitHub, gives you a managed PostgreSQL database, and bills for the compute you use. Out Plane does this with plans from $9 a month, a 14 day free trial, compute metered by the minute, and automatic HTTPS, so you can host a Node app without touching servers or YAML.

What to Look for in Node.js Hosting

Not all Node.js hosting is the same. Four things separate a platform you can grow on from one you will migrate off in six months.

  • Git-push deploys. You connect a repository, push, and the platform builds and ships the new version. No manual scp, no PM2 config, no reverse-proxy setup.
  • No cold starts. At least one instance stays up between requests, so the first visitor after a quiet night waits no longer than the hundredth. Platforms that sleep idle apps make your quietest users wait the most.
  • A managed database next to your app. Most Node apps need Postgres or Redis. Provisioning one from the same platform, with backups handled for you, removes an entire category of work.
  • Predictable pricing. A fixed monthly base with usage metered by the minute, and no surprise minimums, keeps the cost proportional to what your app actually does.

If a host is missing any of these, you will feel it the moment your app has real users.

How Modern Node.js Deploys Work

A modern Node.js host builds your app from source and runs it as a container. The flow is the same whether you use Express, Fastify, NestJS, or a Next.js server:

  1. Connect your repository. The platform reads your package.json, detects Node, installs dependencies, and runs your build.
  2. Bind to the right host and port. Your server must listen on 0.0.0.0 and the port the platform provides through process.env.PORT. This one line is the most common reason a first deploy fails to receive traffic.
  3. Push to deploy. Each push to your connected branch triggers a new build and a zero-downtime release.

On Out Plane, both Cloud Native Buildpacks and a custom Dockerfile are supported, so a plain Node app deploys with zero configuration, and a more complex setup deploys exactly the way you define it. Buildpacks read your package.json, pick a Node version, install dependencies, and run your build and start scripts. If you already maintain a Dockerfile, the platform uses it verbatim, which is the path to take when you need a specific base image, a native dependency, or a multi-stage build.

Binding to 0.0.0.0 and process.env.PORT

The single most common reason a first Node.js deploy fails is the listen line. Locally, app.listen(3000) binds to localhost, which is fine on your laptop. In a hosted container, requests arrive on a network interface that localhost does not cover, and the platform assigns the port through an environment variable rather than letting you hardcode it. The Node.js documentation defines process.env as the object that exposes these injected values at runtime, and process.env.PORT is where the platform tells your app which port to use.

An Express app should read the port from the environment and bind to every interface:

js
const express = require('express');
const app = express();

const port = process.env.PORT || 8080;

app.get('/', (req, res) => {
  res.send('Hello from Node.js');
});

// Bind to 0.0.0.0, not localhost, and use the injected port.
app.listen(port, '0.0.0.0', () => {
  console.log(`Server listening on 0.0.0.0:${port}`);
});

The || 8080 fallback keeps the app runnable locally while deferring to process.env.PORT in production. Get this one line right and the platform can route traffic to your server; get it wrong and the deploy will build cleanly but never receive a request.

Hosting Express, NestJS, and Next.js

The three most common ways to ship a Node.js app each deploy the same way but expose the port line a little differently.

Express and Fastify

Minimal frameworks give you the listen call directly, so you control the host and port as shown above. There is no build step for a plain Express API. The platform installs dependencies and runs node index.js or your start script. This is the lightest possible deploy and a good default for REST APIs, webhooks, and background workers.

If the example above lives in index.js, this is all package.json needs besides your dependencies. The engines field tells Buildpacks which Node version to use:

json
{
  "scripts": {
    "start": "node index.js"
  },
  "engines": {
    "node": ">=20.0.0"
  }
}

To pin the start command outside package.json, add a Procfile (no file extension) to the project root with one line: web: node index.js.

NestJS

NestJS wraps the HTTP server, so the port lives in main.ts. Pass both the port and the host to listen:

ts
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  await app.listen(process.env.PORT ?? 8080, '0.0.0.0');
}
bootstrap();

Because NestJS compiles TypeScript, make sure your build script runs nest build and your start script runs the compiled output (node dist/main). Buildpacks pick this up from package.json automatically. If you use a Procfile, point it at the compiled file: web: node dist/main.js.

Run npm run build locally before you push. A TypeScript error fails the build on the platform just as it does on your machine. If nest build picks up files you did not expect, check tsconfig.build.json, which controls what gets compiled.

Express or NestJS?

Both deploy the same way, so choose on how you want to structure your code. Express is a small request pipeline with no enforced layout. It fits small APIs, prototypes, single-purpose services, and teams small enough to keep conventions informal. NestJS adds modules, controllers, services, and dependency injection, with TypeScript built in. It takes more code for the same endpoint. It pays that back when several developers share a codebase that keeps growing, or when you want its testing module, WebSocket gateways, GraphQL module, or microservice transports. If you need to ship in hours, start with Express. If TypeScript, team size, or long-term maintenance is the main concern, start with NestJS.

Next.js

A Next.js app has two shapes. A static or hybrid export can run on a frontend platform, but a Next.js app with server-side rendering, API routes, or middleware is a long-running Node server and belongs on a platform built to keep a process alive. next start already honors process.env.PORT, so no code change is needed. Deploy the repository, set the build command to next build, and the server binds correctly on its own.

The takeaway across all three: the deploy model is identical, and the only variable is where the port line lives.

Deploying on Out Plane, Step by Step

These steps are the same for Express, NestJS, and any other Node server.

  1. Connect your repository. Sign in at console.outplane.com with GitHub and pick the repository.
  2. Choose a build method. Buildpacks detect Node, install dependencies from package.json, run your build script if there is one, and start the app with your start script or Procfile. Dockerfile builds the image exactly as your Dockerfile defines it.
  3. Set the port and branch. Enter the port your app listens on (8080 in this guide) and the branch to deploy, usually main. Every app runs in Germany, so your data stays in the EU.
  4. Add environment variables. Use Add variable for single values or Edit as .env to paste a block. NODE_ENV is not set for you, so add it here.
  5. Deploy. Click Deploy app. The status moves through Queued, Building, Deploying, and Ready. Once it shows Ready, the URL at the top of the page serves your app over HTTPS.

A typical first set of variables:

text
NODE_ENV=production
DATABASE_URL=postgres://user:password@host:5432/database

Optional: Build with a Dockerfile

Use a Dockerfile when you need a specific base image, a native dependency, or a multi-stage build, then select Dockerfile as the build method. For a plain Express app, one stage is enough:

dockerfile
FROM node:22-alpine

WORKDIR /app

COPY package.json package-lock.json* ./
RUN npm ci --omit=dev

COPY . .

EXPOSE 8080

CMD ["node", "index.js"]

A NestJS app compiles TypeScript first, so use two stages. The final image holds only the compiled output and production dependencies:

dockerfile
# Build stage
FROM node:22-alpine AS builder

WORKDIR /app

COPY package.json package-lock.json* ./
RUN npm ci

COPY . .
RUN npm run build

# Production stage
FROM node:22-alpine

WORKDIR /app

ENV NODE_ENV=production

COPY package.json package-lock.json* ./
RUN npm ci --omit=dev

COPY --from=builder /app/dist ./dist

EXPOSE 8080

CMD ["node", "dist/main.js"]

Deploy from your terminal or a coding agent

The same deploy works from the Out Plane CLI. outplane login opens the console in your browser, where you click Approve. outplane repos lists the GitHub repositories you have connected, and app create starts the first deploy. The CLI builds from a Dockerfile by default. Keep --build buildpack for the Buildpacks setup above, or leave it out if your repository has a Dockerfile. On Windows, install with npm i -g outplane instead of the script.

bash
curl -fsSL https://outplane.com/install.sh | sh
outplane login
outplane repos
outplane app create myapi --repo yourusername/my-node-app --branch main --build buildpack --port 8080:http:public
outplane env set NODE_ENV=production --app myapi --deploy
outplane app get myapi --json --fields status,url
outplane logs myapi --follow

You can also ask Claude Code or another coding agent to deploy the project for you. The install script adds the Out Plane skill to the coding tools it finds, and outplane skills install adds it later if you need to. Restart the tool and ask it to deploy this project to Out Plane. The agent runs these commands itself, and you only click Approve in the browser.

Best Node.js Hosting Options in 2026

The realistic choices for hosting a Node.js app fall into three groups: platform-as-a-service, raw virtual servers, and frontend-focused platforms.

OptionDeploy modelFree tierManaged databaseBest for
Out Plane (PaaS)Git push + Docker14 day trial, then from $9/moPostgreSQL (Redis as a one-click template)Full-stack Node apps that need a database
Traditional PaaSGit pushTrial only, on mostAdd-on, billed separatelySimple apps within trial limits
Virtual server (VPS)Manual / SSHNoneSelf-managedTeams that want full control
Frontend platformsGit pushGenerous for staticLimited or externalStatic sites and serverless functions, not long-running Node servers

For a long-running Node.js server that holds connections, runs background work, or talks to a database, a platform-as-a-service is usually the best fit. A VPS gives you the most control but hands you the operating system, security patching, and process management. Frontend platforms are excellent for static output but are not built to run a persistent Node process.

Free Node.js Hosting

Free Node.js hosting is real, but the details matter. Many "free" offers are 30-day trials that convert to a monthly minimum, which is not the same as a tier your project can live on.

Out Plane does not run a free tier. Starter and Pro each open with a 14 day free trial, and after that Starter is $9 a month with 3 apps, 1 managed database, 5 domains, and $9 of usage already included in the price. What you never pay extra for is the surrounding work: SSL certificates, custom domains, CI/CD, logs, monitoring, and bandwidth come with every plan. Because at least one instance stays up, a low-traffic Express or NestJS app has no cold starts and answers its first request of the day as fast as its last.

Hosting a Node.js App with a Database

A Node.js API almost always needs somewhere to store data. Rather than running your own database server, you provision a managed one from the same platform.

Out Plane provides managed PostgreSQL with automated backups, point-in-time recovery, read replicas, and connection pooling. Redis for caching, sessions, and queues deploys as a one-click template you run yourself. Your app reads the connection string from an environment variable, and compute is metered by the minute, so a quiet service costs less than an always-busy one.

To create the database, open Create → Database in the console and pick a PostgreSQL version from 14 to 18. Frankfurt is the default region and sits in Germany, like your app. Copy the connection URL and add it to your app as DATABASE_URL.

Connecting from Node is a few lines. With the pg driver, read the connection string from the environment rather than committing it to source:

js
import { Pool } from 'pg';

const pool = new Pool({
  connectionString: process.env.DATABASE_URL,
  ssl: { rejectUnauthorized: false },
});

export async function getUser(id) {
  const { rows } = await pool.query(
    'SELECT id, email FROM users WHERE id = $1',
    [id],
  );
  return rows[0];
}

The Pool object matters at scale. A managed database limits how many raw connections it will accept, and a pool lets many requests share a small, fixed number of connections instead of opening one per request. When you run several app instances, connection pooling on the database side keeps the total under the limit even as each instance maintains its own pool. Redis follows the same pattern: read the URL from process.env.REDIS_URL and reuse a single client across requests.

Connections to the managed database require SSL, which is what the ssl option above turns on. ORMs such as Prisma read DATABASE_URL directly. If your connection string does not already include it, append ?sslmode=require.

TypeORM and Prisma

In Express you can use pg directly, or create one Prisma PrismaClient at startup and reuse it across requests. NestJS apps usually wire the ORM into the module system. With TypeORM, install @nestjs/typeorm, typeorm, and pg, then configure it in app.module.ts:

ts
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AppController } from './app.controller';
import { AppService } from './app.service';

@Module({
  imports: [
    TypeOrmModule.forRoot({
      type: 'postgres',
      url: process.env.DATABASE_URL,
      autoLoadEntities: true,
      synchronize: false,
    }),
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}

Keep synchronize: false in production and change the schema through migrations. With Prisma (npm install prisma @prisma/client, then npx prisma init), wrap the client in a service so NestJS opens and closes the connection with the app:

ts
import { Injectable, OnModuleInit, OnModuleDestroy } from '@nestjs/common';
import { PrismaClient } from '@prisma/client';

@Injectable()
export class PrismaService
  extends PrismaClient
  implements OnModuleInit, OnModuleDestroy
{
  async onModuleInit() {
    await this.$connect();
  }

  async onModuleDestroy() {
    await this.$disconnect();
  }
}

Register PrismaService as a provider and inject it wherever you need database access.

Out Plane has no pre-deploy hook, so run migrations in one of two ways. Run them once from the browser terminal on a running instance, for example npx prisma migrate deploy. Or run them on every boot from the start command, such as sh -c "npx prisma migrate deploy && node dist/main.js". With more than one instance, every instance runs the boot migration, so use a tool that takes a lock, such as Prisma.

Environment Variables and Secrets

Configuration that changes between local, staging, and production belongs in environment variables, not in your repository. Database URLs, API keys, and third-party tokens are set on the platform and injected into the process at runtime, where your code reads them through process.env. This keeps secrets out of Git and lets you rotate a key without a code change.

Two practical rules keep this clean. First, never commit a .env file with real credentials; keep a .env.example with blank placeholders so teammates know which keys are required. Second, read every secret through process.env and fail fast at startup if a required one is missing, so a misconfigured deploy stops loudly instead of erroring on the first request. On Out Plane you set these values in the console or through the API token and browser terminal, and they are available to every instance of your app without redeploying your image.

Production Settings for Express and NestJS

A few settings matter once the app runs behind the platform's load balancer.

Trust the proxy. In Express, enable trust proxy so req.ip returns the real client IP and req.protocol reflects the original HTTPS request, read from the X-Forwarded-* headers:

js
app.set('trust proxy', 1);

Shut down cleanly. An instance can be stopped at any time, for example when a new version replaces it. Keep the server that app.listen returns and close it on SIGTERM, so requests in flight finish before the process exits:

js
const server = app.listen(port, '0.0.0.0');

process.on('SIGTERM', () => {
  server.close(() => process.exit(0));
});

In NestJS, call app.enableShutdownHooks() in main.ts before listen. Nest then runs onModuleDestroy hooks, such as the Prisma disconnect above, when the signal arrives.

Set security headers and CORS. helmet sets headers such as Strict-Transport-Security and X-Content-Type-Options. If a frontend on another domain calls your API, allow its exact origin:

js
const helmet = require('helmet');
const cors = require('cors');

app.use(helmet());
app.use(cors({ origin: ['https://yourfrontend.com'] }));

NestJS uses the same pieces in main.ts: app.use(helmet()) and app.enableCors({ origin: process.env.CORS_ORIGIN }).

Custom Domains, Logs, and Metrics

Every app gets a generated .outplane.app URL. To use your own domain, open Domains, click Add domain, enter the domain (for example api.yourdomain.com), and add the DNS records it shows at your registrar. The certificate is issued once DNS propagates.

In the app's sidebar, Logs shows application output and stack traces, Metrics tracks CPU, memory, and network usage, and HTTP Logs lists incoming requests with status codes and response times.

Scaling a Node.js App

Node.js runs your JavaScript on a single thread, so a single instance is bounded by one CPU core for compute-heavy work. Scaling a Node app therefore means running more instances, not a bigger single process. There are two axes.

Horizontal scaling adds instances behind a load balancer. Out Plane runs Node apps across multiple instances with automatic load balancing, and you set the instance count yourself up to your plan ceiling: 1 on Starter, 5 on Pro, 10 on Growth. The platform does not add or remove instances for you, so size for your peak and adjust when the metrics say so. For this to work your app must be stateless: store sessions in Redis or Postgres rather than in process memory, so any instance can serve any request. Instances stay up rather than sleeping, so there are no cold starts at any instance count.

Geographic scaling places instances near users. Out Plane does not do this. Every deployment runs in one region in Germany, which keeps your application and its data inside the EU and makes data residency simple to answer for. For patterns and trade-offs, see horizontal scaling for Node.js. To compare which providers can run a Node API in Europe next to its database, see backend hosting in Europe.

A common migration path is: start with one instance on Starter, add instances once real traffic arrives, move session and cache state into Redis deployed from a one-click template, and add a read replica to your PostgreSQL database when read load grows. Each step is a configuration change, not a rebuild.

Troubleshooting Node.js Deploys

The build succeeds but the app never answers

If the status stays on Deploying or the URL never responds, check the listen line first. The app must bind 0.0.0.0, and the port it listens on must match the port in the app settings.

Module not found

Every package the app needs at runtime belongs under dependencies, not devDependencies. Production installs such as npm ci --omit=dev skip dev dependencies, so a runtime import of one fails only after deploy.

NestJS cannot resolve a dependency

A missing provider or module import fails at startup, not at build time. The logs name the class that could not be resolved. A common cause is a feature module that uses a repository without importing its entity:

ts
@Module({
  imports: [TypeOrmModule.forFeature([User])],
  controllers: [UserController],
  providers: [UserService],
})
export class UserModule {}

500 errors

Open Logs for the stack trace. In Express, register an error handler after your routes so failures are logged and return JSON:

js
app.use((err, req, res, next) => {
  console.error(err.stack);
  res.status(500).json({ error: 'Internal server error' });
});

CORS errors

The allowed origin must match the frontend URL exactly. A different protocol (http vs https) or a trailing slash is enough to block the request.

Out of memory

Watch memory in Metrics. Unbounded caches, unclosed database connections, and event listeners that are never removed are the usual causes. To raise the Node heap limit, set an environment variable, and keep the value below the instance's memory:

text
NODE_OPTIONS=--max-old-space-size=512

How to Choose

If you are hosting a personal project or an early-stage app, start on the smallest plan that fits and keep the option to grow. If you are running a full-stack Node app with a database, choose a platform that provisions both from one place. If you are moving off a platform whose pricing became unpredictable, compare the model directly. A Railway alternative with a fixed monthly base and per-minute compute billing often lowers the bill for low-traffic services.

Ready to deploy? Host your Node.js app on Out Plane and start with a 14 day free trial.


Frequently Asked Questions

What is Node.js hosting?

Node.js hosting is a service that runs your server-side JavaScript application and serves it to users over the internet. Modern Node.js hosting builds your app from a Git repository, runs it as a container, provides a managed database, and handles HTTPS, deploys, and scaling so you never manage a server.

What is the best hosting for a Node.js app?

The best Node.js hosting for most developers is a platform-as-a-service that deploys from GitHub, provides a managed database, and bills for usage. It removes server management while keeping full control of your code. Out Plane offers this with plans from $9 a month, managed PostgreSQL, Redis as a one-click template you run yourself, and compute metered by the minute.

Is there free hosting for Node.js?

Not on Out Plane. Starter and Pro each begin with a 14 day free trial, and after that Starter is $9 a month with a usage allowance included in the base price. Platforms that do offer a permanent free tier usually put idle apps to sleep. Out Plane keeps at least one instance running instead, so a low-traffic Node.js app has no cold starts.

How do I deploy a Node.js app?

Connect your GitHub repository, make sure your server listens on 0.0.0.0 and process.env.PORT, and push. The platform installs dependencies, builds your app, and releases it with zero downtime. Each subsequent push deploys the new version automatically.

Why does my Node.js app deploy but receive no traffic?

The most common cause is listening on localhost or a hardcoded port. A hosted Node app must bind to 0.0.0.0 and the port provided in process.env.PORT. Fix that one line and the platform can route requests to your server.

Can I host a Node.js app with a database?

Yes. On Out Plane you provision managed PostgreSQL alongside your app, or deploy Redis from a one-click template you run yourself, and read the connection string from an environment variable. Backups, point-in-time recovery, read replicas, and connection pooling are handled for you, and compute is metered by the minute.

Do I need a Dockerfile to deploy a Node.js app?

No. Cloud Native Buildpacks read your package.json, choose a Node version, install dependencies, and run your build and start scripts, so a standard Node app deploys with zero configuration. Add a Dockerfile only when you need a specific base image, a native dependency, or a custom multi-stage build. When present, the platform uses it exactly as written.

Can I host a Next.js app that uses server-side rendering?

Yes. A Next.js app with server-side rendering, API routes, or middleware is a long-running Node process and runs well on a platform-as-a-service. next start already reads process.env.PORT, so no code change is needed. Static-only exports can also run on a frontend platform, but a server-rendered Next.js app belongs where a persistent process stays alive.

Does Node.js hosting include a custom domain and HTTPS?

Yes. On Out Plane you point your own domain at the app and HTTPS is provisioned and renewed automatically, so every deploy is served over TLS without you managing certificates. Until you attach a domain, the app is reachable on a generated URL that also serves over HTTPS.

How much does Node.js hosting cost?

Out Plane starts at $9 a month for Starter and $29 for Pro, and each plan opens with a 14 day free trial and includes a monthly usage allowance in the base price. Compute is metered by the minute beyond that allowance, so you pay in proportion to actual usage. For current rates, see /pricing.


Tags

nodejs
hosting
deployment
express
nestjs
paas

Next steps


Related reading


Start deploying in minutes

Connect your GitHub repository and deploy your first application today. Start with a 14-day free trial.

Start 14-day free trial