sota.io

Deploy Node.js

Deploy a Node.js application (Express, Fastify, Koa, etc.) to sota.io.

Auto-Detection

sota.io detects Node.js projects by looking for:

  • package.json with a start script
  • No framework-specific config files (Next.js, etc.)

Quick Deploy

cd my-node-app
sota deploy

Requirements

Your package.json must include a start script:

{
  "scripts": {
    "start": "node server.js"
  }
}

Port Configuration

Your app must listen on the port specified by the PORT environment variable (default: 8080):

const express = require('express');
const app = express();

const PORT = process.env.PORT || 8080;

app.get('/', (req, res) => {
  res.json({ message: 'Hello from sota.io!' });
});

app.listen(PORT, () => {
  console.log(`Server listening on port ${PORT}`);
});

Using a Dockerfile

If your project has a Dockerfile in the root, sota.io will use it instead of auto-detection:

FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --production
COPY . .
EXPOSE 8080
CMD ["node", "server.js"]

Environment Variables

sota env set NODE_ENV=production
sota env set DATABASE_URL=postgres://...

Health Checks

sota.io sends HTTP requests to your app's port to verify it is healthy. Make sure your app responds to requests within 60 seconds of starting.