Node.js
Deploy a Node.js or Express API on Replov
Any Node.js process that listens for HTTP (Express, Fastify, NestJS, Hono, or the built-in http module) runs on Replov as a Web Service with a public HTTPS address. A process that does not serve HTTP, such as a queue consumer, runs as a Background Worker; an internal API that only your other services call runs as a Private Service.
Last verified against the product on .
Before you start
- A Node.js app in a GitHub repository with package.json and a committed lockfile.
- An app that reads its port from the PORT environment variable and binds to 0.0.0.0.
How Replov builds it
- Replov detects Node.js from package.json and generates a Dockerfile; it installs dependencies with the package manager that matches your lockfile.
- A Node version declared in .nvmrc, .node-version or the engines field of package.json is used; otherwise the platform default is used and the build log says so.
- A Dockerfile in the service’s root directory replaces the generated one.
Deploy it
- 1
Sign in to Replov and connect GitHub (Connect GitHub / Import from GitHub). Replov asks for access to the repositories you choose.
- 2
Create a project for the repository, then add a service to it.
- 3
Choose Service Type: Web Service (or Background Worker / Private Service), select the repository and Branch, and set Root Directory if the app lives in a subfolder.
- 4
Set Build Command if your app needs a build step (for example
npm run buildfor TypeScript) and Start Command, for examplenode server.jsornpm start. - 5
Add Environment Variables. Use secrets for credentials.
- 6
Optional, web services only: set a Health Check Path such as /health in the service settings.
- 7
Pick a compute tier and deploy.
Example: server.js (Express)
const express = require('express');
const app = express();
app.get('/health', (req, res) => res.json({ status: 'ok' }));
app.get('/', (req, res) => res.json({ message: 'Hello from Replov' }));
const port = process.env.PORT || 3000;
app.listen(port, '0.0.0.0', () => console.log(`listening on ${port}`));Environment variables and ports
- Read the port from process.env.PORT. Replov sets it; do not hard-code another port.
- Bind to 0.0.0.0, not localhost, so the router can reach the container.
- Secrets are encrypted at rest and injected at runtime only.
Domains and HTTPS
Every web service and static site gets an HTTPS address of the form <service-name>-<4 characters>.replov.com once it is live.
To use your own domain, open the service, choose Connect Domain and publish the CNAME and TXT records Replov shows at your DNS provider. After verification Replov routes the hostname and issues a Let’s Encrypt certificate automatically. More on HTTPS.
Logs and monitoring
The build log streams while the deployment runs; the first failing command and the lines just above it usually explain a failed build. Runtime logs (with live streaming) and CPU, memory and network metrics are on the service page. See service logs.
Troubleshooting
- The deployment fails its health check
- The app is probably listening on a hard-coded port or on localhost. Use process.env.PORT and 0.0.0.0.
- “Cannot find module” at start
- The module is in devDependencies but needed at runtime, or the start command points at a file that only exists after a build step you did not configure.
- The service restarts repeatedly
- Check runtime logs for an uncaught exception at startup, often a missing environment variable.
Related
Deploy your repository on Replov
Connect GitHub, choose a service type and a compute tier, and watch the build log.