Guide
Deployment
Deploy your UNuxt application to production
UNuxt is Docker-ready and can be deployed to any platform that supports Node.js or containers.
Deploy with Docker
Use the included Docker configuration for production deployment.
Build and run
# Build and start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
Configure production environment
Create a production .env file with secure values:
.env.production
NODE_ENV=production
DATABASE_URL=postgresql://user:password@db:5432/unuxt
BETTER_AUTH_SECRET=your-secure-secret-min-32-chars
BETTER_AUTH_URL=https://your-domain.com
Deploy manually
Build and run without Docker.
Build the application
# Build all packages and apps
pnpm build
Start the production server
# Start the web app
node apps/web/.output/server/index.mjs
Deploy to Vercel
- Connect your repository to Vercel
- Set the root directory to
apps/web - Configure environment variables in the Vercel dashboard
- Deploy
vercel.json
{
"buildCommand": "cd ../.. && pnpm build",
"outputDirectory": ".output"
}
Deploy to Cloudflare Pages
- Connect your repository to Cloudflare Pages
- Set the build command:
pnpm build
- Set the output directory:
apps/web/.output/public
- Add environment variables in the Cloudflare dashboard
Deploy to Netlify
- Connect your repository to Netlify
- Configure build settings:
netlify.toml
[build]
command = "pnpm build"
publish = "apps/web/.output/public"
[build.environment]
NODE_VERSION = "20"
Configure the database
For production, use a managed PostgreSQL service:
- Neon - Serverless Postgres
- Supabase - Postgres with extras
- Railway - Simple deployment
- PlanetScale - MySQL alternative
Update your DATABASE_URL with the production connection string.
Set up SSL
Ensure your production environment uses HTTPS. Most platforms handle this automatically, but for self-hosted deployments:
nginx.conf
server {
listen 443 ssl;
server_name your-domain.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Monitor your application
Add monitoring for production visibility:
nuxt.config.ts
export default defineNuxtConfig({
// Add error tracking
runtimeConfig: {
public: {
sentryDsn: process.env.SENTRY_DSN
}
}
})