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.
- 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.
Make the app listen on the right address and port
Listen on
0.0.0.0, notlocalhost, and read the port fromPORT. The standard build setsPORTto 3000 unless you set your own.A
/healthroute that returns 200 gives a stronger check before a release goes live.server.js: a small server that is ready to deployconst 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}`));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
maininpackage.json, thenserver.jsat the top of the project, thennpm start.npm initoften writes"main": "index.js". If your app starts from another file, correctmainor remove it.If there is a
buildscript, 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" } }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.jsonhas amainfile, check thatnodecan start that file.Install exactly what the lockfile saysnpm ciBuild, if there is a build scriptnpm run build --if-presentStart on port 3000PORT=3000 npm startIn a second terminal, check the health routecurl http://localhost:3000/healthConnect your server
In the dashboard, open
Servers, pressAdd serverand chooseRun 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-pagerPrefer not to use a terminal? The connect screen also offers a password or SSH key login, and an AWS account connection for EC2.
Add the app and deploy
Open
Appsand pressDeploy app. Import the project fromGitHub, paste a public address underGit URL, or drop a folder or ZIP underUpload.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. Set the health check and follow the release
In the app's
Settings,Health checkis onAutoat first: Opslin tries your path, then/health,/api/health,/ready,/pingand/. 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
Liveand its address answers in the browser. - The
Logstab shows your start message and no repeating errors. - The health route returns 200.
curl -i https://api.example.com/healthWhich 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.
| Project | How it runs |
|---|---|
| Express or plain Node.js | main file, then server.js, then npm start |
| NestJS | main file, or dist/main.js after the build |
| Next.js | next start, standalone or static export |
| Nuxt | The built Node server in .output |
| SvelteKit | The Node adapter build (@sveltejs/adapter-node) |
| Remix | remix-serve with the built app |
| Astro | Static files, or its Node server build |
| React (Vite or Create React App) | Built files served as a website |
| Angular | Built 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.
EXPOSE 3000Where do I see logs?
In the app's Logs tab: switch between runtime and build output, search, filter by level 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.
Open the app, go to
Domains, pressAdd domainand type the name withouthttps://.At your DNS provider, add the
Arecord the dashboard shows: the name (@for the root domain) and your server's IP address.Opslin checks every minute, and
Verify domainchecks now. It usually takes under 10 minutes.Opslin then requests a free Let's Encrypt certificate. Ports 80 and 443 must be open.
Retry HTTPStries again.
dig +short shop.example.comCustom 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.
| Plan | Free | Starter | Pro | Business |
|---|---|---|---|---|
| Rollback | Limited | Last release | Any release | Any 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, notlocalhost, and use thePORTenvironment 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'sSettings.
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.jsonstops the install. Runnpm installon your computer, commit the new lockfile and push. For other errors, read thebuildoutput inLogs.
Bring the lockfile up to datenpm installContainer crashed before health check
- What it means
- The app exited before Opslin could reach it.
- Fix
- Read the runtime output in
Logs. Check thatmaininpackage.jsonpoints 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
Environmenttab and pressSave 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 generatewhen it finds Prisma. If you still see this, add"postinstall": "prisma generate"to your scripts. Do not useprisma migrate devin production.
Port is already in use
- What it means
- Another program or container holds the port the app asked for.
- Fix
- Change the
PORTvariable 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 serverfree -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