Deploy a Node.js app to a VPS, without PM2 or Nginx setup.

Make your app listen on 0.0.0.0 and the PORT variable, put it on GitHub, connect your VPS to Opslin and press Deploy. The standard build uses Node.js 20, runs your app in Docker on your server and checks it before it goes live.

Last checked 29 November 2026

Node.js version
20 in the standard build
Port
3000, read from PORT
No need for
PM2 or hand-written Nginx files
Code from
GitHub, a public Git URL, a folder or a ZIP

Who is this guide for?

You have an Express, NestJS or plain Node.js app (or Nuxt, SvelteKit, Remix or Astro) and want it on your own server without writing process manager and web server configuration. For Next.js, use the Next.js guide.

What you need

  • A Linux server you control, with root or sudo: Ubuntu, Debian, Fedora, Alpine or Arch, on 64-bit x86 or ARM.
  • At least 1.5 GB of free disk to install the agent. 5 GB or more is comfortable.
  • About 1 GB of memory or more. Smaller servers may run out of memory during a build.
  • Outbound HTTPS (port 443). Open inbound ports 80 and 443 so visitors and SSL certificates can reach your app.
  • A Node.js app with a package.json, in GitHub, at a public Git address, or as a folder or ZIP (up to 500 MB).
  • An Opslin account with a verified email. The Free plan covers 1 server and 2 apps.

How do I deploy a Node.js app on my server?

Prepare the app once, connect the server once, then deploy.

  1. Make the app listen on the right address and port

    Listen on 0.0.0.0, not localhost, and read the port from PORT. The standard build sets PORT to 3000 unless you set your own.

    A /health route that returns 200 gives a stronger check before a release goes live.

    server.js: a small server that is ready to deploy
    const http = require("node:http");
    
    const port = Number(process.env.PORT) || 3000;
    
    http
      .createServer((req, res) => {
        if (req.url === "/health") return res.end("ok");
        res.end("Hello from your server");
      })
      .listen(port, "0.0.0.0", () => console.log(`Listening on ${port}`));
  2. Check the start file and the build script

    For Express and plain Node.js apps, the standard build picks the start command in this order: the file named in main in package.json, then server.js at the top of the project, then npm start.

    npm init often writes "main": "index.js". If your app starts from another file, correct main or remove it.

    If there is a build script, Opslin runs it. Commit your lockfile so the server installs the same packages you did.

    package.json for a TypeScript app
    {
      "main": "dist/server.js",
      "scripts": {
        "build": "tsc",
        "start": "node dist/server.js"
      }
    }
  3. Test the production start on your computer

    Run the same steps from a clean install. Errors are much quicker to fix here than on the server.

    If your package.json has a main file, check that node can start that file.

    Install exactly what the lockfile says
    npm ci
    Build, if there is a build script
    npm run build --if-present
    Start on port 3000
    PORT=3000 npm start
    In a second terminal, check the health route
    curl http://localhost:3000/health
  4. Connect your server

    In the dashboard, open Servers, press Add server and choose Run one command. Copy the command it shows, open a terminal on your server and paste it.

    The installer needs administrator rights. If you do not log in as root, it must run with sudo; choose your provider on that screen to get the right command.

    It installs Docker if needed and starts the Opslin agent, which connects out to Opslin. If the terminal prints a link to verify the server, open it while signed in. The link works for 1 hour.

    Choose a method, then run the command your dashboard shows.
    Check the agent on your server (systemd)
    sudo systemctl status opslin-agent --no-pager

    Prefer not to use a terminal? The connect screen also offers a password or SSH key login, and an AWS account connection for EC2.

  5. Add the app and deploy

    Open Apps and press Deploy app. Import the project from GitHub, paste a public address under Git URL, or drop a folder or ZIP under Upload.

    Name the project, pick your server, add your environment variables and press Deploy.

    The standard build installs with npm, Yarn or pnpm according to your lockfile, builds a Docker image on your server and starts the app.

    Name the project, pick your server and press Deploy.
  6. Set the health check and follow the release

    In the app's Settings, Health check is on Auto at first: Opslin tries your path, then /health, /api/health, /ready, /ping and /. If a backend app opens its port but none of these returns 200, Auto accepts it with a warning.

    For a worker with no web address, choose Background worker (no port).

    Auto suits most apps.
    The new version takes traffic only after its health check passes.

How do I know it worked?

  • The app shows Live and its address answers in the browser.
  • The Logs tab shows your start message and no repeating errors.
  • The health route returns 200.
Check the health route (use your app's address)
curl -i https://api.example.com/health

Which Node.js frameworks does Opslin recognise?

Opslin picks a build for the framework it finds. You can change the choice in the app's Settings.

Node.js frameworks and how the standard build starts them
ProjectHow it runs
Express or plain Node.jsmain file, then server.js, then npm start
NestJSmain file, or dist/main.js after the build
Next.jsnext start, standalone or static export
NuxtThe built Node server in .output
SvelteKitThe Node adapter build (@sveltejs/adapter-node)
Remixremix-serve with the built app
AstroStatic files, or its Node server build
React (Vite or Create React App)Built files served as a website
AngularBuilt app, as static files or its server build

The standard build uses Node.js 20. If you need another version or system packages, add your own Dockerfile at the top of the repository and Opslin builds that instead. Name the port your app listens on with EXPOSE; without it, port 8080 is assumed.

In a Dockerfile, state the port
EXPOSE 3000

Where do I see logs?

In the app's Logs tab: switch between runtime and build output, search, filter by level and download.

Runtime and build output, with search and download.

How do I add my own domain with HTTPS?

Add the domain in the app, create one A record at your domain provider and let Opslin check it.

  1. Open the app, go to Domains, press Add domain and type the name without https://.

  2. At your DNS provider, add the A record the dashboard shows: the name (@ for the root domain) and your server's IP address.

  3. Opslin checks every minute, and Verify domain checks now. It usually takes under 10 minutes.

  4. Opslin then requests a free Let's Encrypt certificate. Ports 80 and 443 must be open. Retry HTTPS tries again.

One A record at your domain provider, then Opslin checks it.
See which IP your domain points to
dig +short shop.example.com

Custom domains on server apps need the Starter plan or higher. The Free plan gives each app a temporary Opslin address with SSL. Compare plans.

How do I roll back a bad release?

Open the app's Deployments tab, press Roll back next to an earlier successful release and confirm.

Opslin deploys that version again and re-applies your domain. The release you replaced stays in the history. Rolling back changes your code, not the data or structure of your database.

An earlier successful release can be deployed again.
Rollback by plan
PlanFreeStarterProBusiness
RollbackLimitedLast releaseAny releaseAny release

What can go wrong, and how do I fix it?

  • App not listening on port

    What it means
    The app started, but nothing answered on the port Opslin expects.
    Fix
    Listen on 0.0.0.0, not localhost, and use the PORT environment variable.
  • Health check path returned 404

    What it means
    The app is running, but the health path you set does not return HTTP 200.
    Fix
    Set the path to a route that returns 200, such as /health, in the app's Settings.
  • Build command failed

    What it means
    The code was fetched, but installing packages or building ended with an error.
    Fix
    A lockfile that does not match package.json stops the install. Run npm install on your computer, commit the new lockfile and push. For other errors, read the build output in Logs.
    Bring the lockfile up to date
    npm install
  • Container crashed before health check

    What it means
    The app exited before Opslin could reach it.
    Fix
    Read the runtime output in Logs. Check that main in package.json points to a file that exists after the build.
  • Required environment variable is missing

    What it means
    The app started without a value it needs.
    Fix
    Add it in the app's Environment tab and press Save and redeploy.
  • Prisma client was not generated

    What it means
    The app uses Prisma, but the client was not created during the build.
    Fix
    Opslin runs prisma generate when it finds Prisma. If you still see this, add "postinstall": "prisma generate" to your scripts. Do not use prisma migrate dev in production.
  • Port is already in use

    What it means
    Another program or container holds the port the app asked for.
    Fix
    Change the PORT variable or stop the other process, then deploy again.
  • Container ran out of memory

    What it means
    The build or the app was stopped because the server did not have enough memory.
    Fix
    Free memory on the server or use one with more. Opslin builds on your server, so build size matters.
    See memory on the server
    free -h

What should I do next?

  • Deploy on every pushConnect GitHub and release each commit.GitHub guide
  • Let an assistant helpOpslin MCP (beta) can deploy, check health and read logs.About MCP
  • How releases workFrom your code to a live app, step by step.How it works

Questions people ask

Do I need PM2 on my VPS?

No. Opslin runs your app in a Docker container that restarts automatically unless you stop it.

Do I need to configure Nginx?

No. Opslin sets up the web route for your app's address and requests the certificate.

Which Node.js version does Opslin use?

The standard build uses Node.js 20. Add your own Dockerfile for another version.

Can I deploy a TypeScript app?

Yes. Compile in the build script and point main or start at the compiled file.

Can I use Yarn or pnpm?

Yes. The standard build picks the package manager from your lockfile.

My repository has a docker-compose.yml. What happens?

A Compose file at the top of the repository can be run as a project with several services instead of a single app. Check the review screen before you deploy.

Can I add a database?

Managed PostgreSQL, MySQL, MongoDB and Redis on your server start with the Starter plan. You can also connect any external database with an environment variable.

Is it free?

The Free plan covers 1 server and 2 apps that you own. Custom domains on server apps need the Starter plan or higher. See pricing

Related pages

Try it with your own project.

  • Free plan: 1 server and 2 apps
  • Your server or your Cloudflare account