All Guides
Frameworks12 min read

Deploy Node.js / Next.js

Deploy Node.js and Next.js applications with automatic framework detection, build optimization, and zero-config SSL.

1.Framework Auto-Detection

Oxaploy automatically detects Node.js and Next.js projects.

  1. Push your Node.js/Next.js project to Git
  2. Create new app in Oxaploy — framework auto-detected
  3. Next.js: detected via next in dependencies or next.config.js
  4. Node.js: detected via package.json with start script
  5. Override detection in app settings if needed

2.Build and Start Commands

Configure the correct build and start commands for your framework.

  1. Next.js: Build npm run build, Start npm start
  2. Express/Fastify: Build npm run build (if TypeScript), Start npm start
  3. Custom build: add npm run build:prod or similar
  4. Monorepos: specify working directory in app settings
# package.json examples:
# Next.js
"scripts": { "build": "next build", "start": "next start" }

# Express (TypeScript)
"scripts": { "build": "tsc", "start": "node dist/index.js" }

# Vite + React
"scripts": { "build": "vite build", "start": "vite preview --port $PORT" }

3.Environment Variables

Configure production environment variables.

  1. Set NODE_ENV=production (auto-set by Oxaploy)
  2. Database: DATABASE_URL, REDIS_URL
  3. Secrets: JWT_SECRET, API_KEYS, SESSION_SECRET
  4. Next.js: NEXT_PUBLIC_* for client-side vars
  5. Port: Oxaploy sets PORT automatically — use process.env.PORT

4.Custom Domains and SSL

Configure production domains with automatic SSL.

  1. In app settings, go to Domains tab
  2. Add your custom domain (e.g., app.example.com)
  3. Oxaploy provisions Let's Encrypt SSL automatically
  4. DNS: add CNAME pointing to your Oxaploy server IP
  5. SSL auto-renews 30 days before expiry
  6. Force HTTPS enabled by default