Skip to content

Deploy a Node.js or Express app

This guide replaces the old “How to deploy a Node.js app on DockHive” page.

Push your code to GitHub, start a new app, pick the repository and click Deploy with Drone. Or run hivepod deploy in the project folder.

Pick Express (also for Fastify, Koa and Hapi), NestJS, or Node.js for any server started by npm start or its main file.

Your server must listen on 0.0.0.0 and on the port in the PORT environment variable:

server.js
import express from 'express';
const app = express();
app.get('/', (req, res) => res.send('Hello from DockHive'));
const port = process.env.PORT || 3000;
app.listen(port, '0.0.0.0', () => console.log(`Listening on ${port}`));
package.json
{
"type": "module",
"scripts": {
"start": "node server.js"
}
}
  • Commit your lockfile (package-lock.json, pnpm-lock.yaml or yarn.lock) so installs are repeatable.
  • To pick a Node.js version (20, 22 or 24; the default is 22), set engines.node in package.json, for example "engines": { "node": "20" }.
  • Keep secrets in environment variables, not in .env files in the repository.