Skip to main content
The Node.js preset provides Node.js 20 with npm, managed by a systemd service for automatic restarts and logging.

What’s Included

ComponentVersionDetails
Node.js20 LTSJavaScript runtime
npmBundled with Node.jsPackage manager
systemdProcess manager (app service)
SSHOpenSSHAccess via dedicated port

Directory Structure

/home/instapod/app/
├── package.json
├── index.js            # (or your entry point)
└── node_modules/       # (after npm install)
  • App Root: /home/instapod/app
  • App Port: 3000 (your app must listen on this port)

How the App Service Works

Your Node.js app runs as a systemd service called app. It:
  • Starts automatically on boot
  • Restarts on crash
  • Logs to the system journal (viewable via the Logs tab or CLI)
  • Runs as the instapod user
The service expects your app to listen on port 3000. The nginx proxy on the server forwards traffic from your pod’s public URL to this port.

Deploying Your App

Upload and Start

# Sync your project
instapod files sync my-node-app --local ./my-project

# Install dependencies
instapod exec my-node-app -- npm install --production

# Restart the app service
instapod pods reload my-node-app

Example Express App

// index.js
const express = require('express');
const app = express();

app.get('/', (req, res) => {
  res.send('Hello from InstaPods!');
});

app.listen(3000, '0.0.0.0', () => {
  console.log('Server running on port 3000');
});
{
  "name": "my-app",
  "main": "index.js",
  "scripts": {
    "start": "node index.js"
  },
  "dependencies": {
    "express": "^4.18.0"
  }
}

Viewing Logs

instapod logs my-node-app -s app

Adding a Database

instapod services add my-node-app --service postgresql --wait
instapod services creds my-node-app --service postgresql

Use Cases

  • Express / Fastify APIs
  • Next.js applications
  • GraphQL servers
  • Real-time apps with WebSockets
  • Background workers and job queues