Self-hosting
Run ContentAI on your own VPS with Docker or PM2.
ContentAI is a standard Next.js 16 app, so anything that can run Node.js can host it.
Option A — Docker (recommended)
Dockerfile
Create Dockerfile at the project root:
FROM node:20-alpine AS base
WORKDIR /app
FROM base AS deps
COPY package.json pnpm-lock.yaml ./
RUN corepack enable pnpm && pnpm install --frozen-lockfile
FROM base AS builder
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN corepack enable pnpm && pnpm build
FROM base AS runner
ENV NODE_ENV=production
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
EXPOSE 3000
CMD ["node", "server.js"]Enable standalone output in next.config.ts:
const nextConfig = {
output: "standalone",
};Build and run
docker build -t contentai .
docker run -d -p 3000:3000 --restart unless-stopped --name contentai contentaiDocker Compose
services:
contentai:
build: .
ports:
- "3000:3000"
restart: unless-stopped
environment:
- NODE_ENV=productionOption B — PM2 on a VPS
# On the server
git clone <your-repo> /srv/contentai
cd /srv/contentai
pnpm install
pnpm build
pnpm add -g pm2
pm2 start pnpm --name contentai -- start
pm2 save
pm2 startup # follow printed instructionsReverse proxy with Nginx
server {
listen 80;
server_name contentai.example.com;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}Enable HTTPS with Certbot:
sudo certbot --nginx -d contentai.example.comOption C — Cloudflare Pages / Workers
Cloudflare Pages supports Next.js via the @cloudflare/next-on-pages adapter. Note: some AI SDK features rely on Node.js APIs that may require an edge-compatible patch. Vercel or Netlify is friction-free in comparison.
Option D — Railway / Render / Fly.io
All three host Next.js out of the box. Railway is closest to "click-and-deploy"; Fly.io offers global regions.
Sizing
ContentAI is very lightweight at runtime — the AI inference happens on the provider's servers. A 1 vCPU / 1 GB VPS handles the app comfortably for 100s of concurrent users.
Next: Authentication & database (NextAuth + Supabase) → · Add Supabase (alternate recipes) →