How to Deploy a Node.js App

Deploy a Node.js app to production in under 5 minutes with NEXUS AI. No Dockerfile, no cloud console, no DevOps setup. Point the CLI at your GitHub repo and NEXUS AI detects Node.js, builds a production container image, and ships it to AWS, GCP, or Azure automatically.

Prerequisites

Deploy a Node.js app: step by step

Step 1 — Install the NEXUS AI CLI
npm install -g @nexusai/cli
Step 2 — Authenticate
nexus login

Opens a browser window to complete authentication. For CI/CD, set the NEXUSAI_TOKEN environment variable instead.

Step 3 — Deploy from source
nexus deploy source \
  --repo https://github.com/your/node-app \
  --name my-node-app \
  --provider gcp_cloud_run

NEXUS AI reads your package.json, detects the Node.js runtime and start script, builds a production container image, and deploys it. No Dockerfile needed.

Step 4 — Check status and get your URL
nexus deploy status --deployment-id <id>

Set environment variables for your Node.js app

Use nexus secret set to configure environment variables securely:

nexus secret set \
  DATABASE_URL=postgres://user:pass@host/db \
  NODE_ENV=production \
  PORT=3000

Secrets are encrypted at rest and injected at container start. Run nexus deploy redeploy after adding secrets to apply them.

Redeploy on every push

Add NEXUS AI to your GitHub Actions workflow to automate deployments:

- name: Deploy Node.js app
  run: nexus deploy redeploy --deployment-id ${{ secrets.NEXUSAI_DEPLOYMENT_ID }}
  env:
    NEXUSAI_TOKEN: ${{ secrets.NEXUSAI_TOKEN }}
Deploy your Node.js app free →

Frequently asked questions

Do I need a Dockerfile to deploy a Node.js app?

No. NEXUS AI detects Node.js from your package.json and generates an optimized container image automatically. You never need to write or maintain a Dockerfile.

Which Node.js frameworks does NEXUS AI support?

All major frameworks: Express, Fastify, NestJS, Next.js, Hono, and plain Node.js HTTP servers. Detection is automatic from your package.json and start script.

How do I set environment variables for my Node.js app?

Use nexus secret set KEY=value. Secrets are encrypted at rest with AES-256-GCM and injected as environment variables when the container starts.

Which cloud providers can I deploy my Node.js app to?

AWS ECS Fargate (aws_ecs_fargate), Google Cloud Run (gcp_cloud_run), and Azure Container Apps (azure_container_apps). Switch with the --provider flag at any time.