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.
- Push your Node.js/Next.js project to Git
- Create new app in Oxaploy — framework auto-detected
- Next.js: detected via next in dependencies or next.config.js
- Node.js: detected via package.json with start script
- Override detection in app settings if needed
2.Build and Start Commands
Configure the correct build and start commands for your framework.
- Next.js: Build npm run build, Start npm start
- Express/Fastify: Build npm run build (if TypeScript), Start npm start
- Custom build: add npm run build:prod or similar
- 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.
- Set NODE_ENV=production (auto-set by Oxaploy)
- Database: DATABASE_URL, REDIS_URL
- Secrets: JWT_SECRET, API_KEYS, SESSION_SECRET
- Next.js: NEXT_PUBLIC_* for client-side vars
- Port: Oxaploy sets PORT automatically — use process.env.PORT
4.Custom Domains and SSL
Configure production domains with automatic SSL.
- In app settings, go to Domains tab
- Add your custom domain (e.g., app.example.com)
- Oxaploy provisions Let's Encrypt SSL automatically
- DNS: add CNAME pointing to your Oxaploy server IP
- SSL auto-renews 30 days before expiry
- Force HTTPS enabled by default