Deploy a Node.js or Express app
This guide replaces the old “How to deploy a Node.js app on DockHive” page.
With Drone (recommended)
Section titled “With Drone (recommended)”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.
With a preset
Section titled “With a preset”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:
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}`));{ "type": "module", "scripts": { "start": "node server.js" }}- Commit your lockfile (
package-lock.json,pnpm-lock.yamloryarn.lock) so installs are repeatable. - To pick a Node.js version (20, 22 or 24; the default is 22), set
engines.nodeinpackage.json, for example"engines": { "node": "20" }. - Keep secrets in environment variables, not in
.envfiles in the repository.