Deployment
OberonCMS applications are built on Next.js and can be deployed to any platform that supports Node.js 22+. Here’s how to deploy your OberonCMS app to popular platforms.
Before You Deploy
- Build locally to test:
npm run build
npm run start- Set environment variables on your hosting platform
- Verify database migrations have run
- Test the editor at
/cmswith your admin credentials
Vercel (Recommended)
Vercel is the easiest option for Next.js applications and offers a free tier.
Setup
- Push your code to GitHub
- Go to vercel.com
- Click “New Project” and select your repository
- Vercel auto-detects Next.js
- Add your environment variables in “Environment Variables”
- Click “Deploy”
Environment Variables
In Vercel Dashboard → Settings → Environment Variables, add:
TURSO_URL=libsql://your-db.turso.io
TURSO_TOKEN=your-token
OBERON_SITE_URL=https://your-domain.vercel.app
EMAIL_FROM=noreply@your-domain.com
SEND_SECRET=your-email-secret
UPLOADTHING_SECRET=your-uploadthing-secret
UPLOADTHING_APP_ID=your-uploadthing-app-idCustom Domain
- Go to your project’s Domain settings
- Add your domain (e.g.,
yoursite.com) - Update DNS records per Vercel’s instructions
Vercel provides automatic HTTPS, global CDN, and serverless functions out of the box.
Docker
For self-hosted or containerized deployments:
Dockerfile
FROM node:22-alpine AS builder
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm && pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
FROM node:22-alpine
WORKDIR /app
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/package.json ./
COPY --from=builder /app/public ./public
ENV NODE_ENV=production
EXPOSE 3000
CMD ["npm", "start"]Environment Variables
Pass environment variables to the container:
docker run \
-e TURSO_URL=libsql://your-db.turso.io \
-e TURSO_TOKEN=your-token \
-e OBERON_SITE_URL=https://yourdomain.com \
-p 3000:3000 \
oberon-cms:latestRailway
Railway offers a simple interface for deploying Node.js apps:
- Connect your GitHub repo
- Railway auto-detects Next.js
- Add environment variables in Railway dashboard
- Deploy with one click
Railway handles scaling, SSL, and monitoring.
AWS (EC2 / App Runner)
For production workloads:
EC2
- Launch an Ubuntu 24.04 instance (min. t3.small)
- SSH into the instance
- Install Node.js 22 and pnpm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
nvm install 22
npm install -g pnpm- Clone your repo:
git clone your-repo-url
cd your-app- Install dependencies and build:
pnpm install
pnpm build- Set up environment variables:
nano .env.production.local- Start the app:
npm startUse PM2 for process management:
npm install -g pm2
pm2 start "npm start" --name "oberon"
pm2 save
pm2 startupApp Runner
AWS App Runner automates container deployment:
- Build a Docker image (see Docker section above)
- Push to AWS ECR
- Create an App Runner service
- Configure environment variables
- App Runner handles auto-scaling and SSL
Self-Hosted Linux
For maximal control:
Prerequisites
- Ubuntu/Debian server
- Node.js 22+
- pnpm
- Nginx (reverse proxy)
- PostgreSQL or Turso (for database)
Steps
- Clone and build:
git clone your-repo
cd your-app
pnpm install
pnpm build- Configure Nginx:
server {
listen 80;
server_name yourdomain.com;
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;
}
}- Use systemd service:
[Unit]
Description=OberonCMS
After=network.target
[Service]
Type=simple
User=www-data
WorkingDirectory=/var/www/oberon-cms
ExecStart=/usr/bin/npm start
Restart=always
Environment="NODE_ENV=production"
EnvironmentFile=/var/www/oberon-cms/.env.production
[Install]
WantedBy=multi-user.target- Enable and start:
systemctl enable oberon
systemctl start oberonDatabase Setup
Turso (Cloud SQLite)
Turso is the recommended database for OberonCMS:
- Create account at turso.tech
- Create a database:
turso db create my-oberon-db- Get connection URL and token:
turso db show --url my-oberon-db
turso db tokens create my-oberon-db --expiration none- Set environment variables with the values
PostgreSQL
For PostgreSQL deployments:
- Provision a PostgreSQL instance
- Use the PostgreSQL plugin:
npm install @oberoncms/plugin-pgsql- Set connection URL:
DATABASE_URL=postgresql://user:password@host:5432/dbnameSSL/HTTPS
Always use HTTPS in production. Never expose your editor over HTTP.
- Vercel: Automatic ✓
- Railway: Automatic ✓
- Self-hosted: Use Let’s Encrypt with Certbot
apt install certbot python3-certbot-nginx
certbot --nginx -d yourdomain.comMonitoring
Logging
Ensure your hosting platform logs errors:
- Vercel: Automatic via dashboard
- Docker: Use
docker logs - systemd:
journalctl -u oberon -f
Performance
Monitor key metrics:
- Response time: Should be < 500ms
- Database queries: Check query logs
- CSS generation: Verify Tailwind plugin working
- Image uploads: Confirm Uploadthing processing
Health Checks
Set up health checks on your hosting platform:
export async function GET() {
// Check database connectivity
const healthy = true // implement your checks
return new Response(JSON.stringify({ status: healthy ? "ok" : "error" }), {
status: healthy ? 200 : 503,
headers: { "Content-Type": "application/json" },
})
}Troubleshooting Deployments
Build fails? Check that all required environment variables are set.
Editor won’t load? Verify OBERON_SITE_URL matches your deployment URL.
Database connection errors? Check that database credentials are correct and the database is accessible from your deployment environment.