First Deployment
Get your EreoJS application deployed in minutes. This guide covers three options: running Bun directly on a server, containerizing with Docker, and deploying to Vercel.
Build for Production
All deployment methods start with a production build:
bun run buildThis creates an optimized build in the .ereo/ directory with server bundles, client assets, and a build manifest.
Option 1: Bun (Self-Hosted)
The simplest path -- run your build directly with Bun on any Linux or macOS server.
1. Install Bun on your server:
curl -fsSL https://bun.sh/install | bash2. Copy your project to the server (via scp, rsync, or your CI pipeline):
rsync -avz --exclude node_modules ./ user@server:/var/www/app/3. Install dependencies and build:
cd /var/www/app
bun install --frozen-lockfile
bun run build4. Start the server:
NODE_ENV=production bun ereo startFor production, use a process manager like PM2 or systemd to keep the server running. See Deploying with Bun for PM2 and systemd configuration.
Option 2: Docker
Package your application in a container for consistent deployments across any infrastructure.
1. Create a Dockerfile:
FROM oven/bun:1-slim AS deps
WORKDIR /app
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile --production
FROM oven/bun:1 AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN bun run build
FROM oven/bun:1-slim AS runner
WORKDIR /app
ENV NODE_ENV=production
COPY --from=builder /app/.ereo ./.ereo
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./
EXPOSE 3000
CMD ["bun", "ereo", "start"]2. Build and run:
docker build -t my-app .
docker run -p 3000:3000 my-appSee Deploying with Docker for multi-stage builds, Docker Compose, and Kubernetes configurations.
Option 3: Vercel
Deploy to Vercel with zero infrastructure management.
1. Install the deploy adapter:
bun add @ereo/deploy-vercel2. Update your config:
// ereo.config.ts
import { defineConfig } from '@ereo/core'
import { vercel } from '@ereo/deploy-vercel'
export default defineConfig({
...vercel(),
})3. Deploy:
npx vercelOr push to GitHub with Vercel's Git integration enabled for automatic deploys on every push.
See Deploying to Vercel for environment variables, edge functions, and custom domain setup.
Health Check Endpoint
Regardless of platform, add a health check route for monitoring:
// routes/api/health.ts
export function GET() {
return Response.json({
status: 'ok',
timestamp: new Date().toISOString(),
})
}Environment Variables
Set environment-specific values in .env.production:
NODE_ENV=production
PORT=3000
DATABASE_URL=postgres://...EreoJS loads .env.production automatically when NODE_ENV=production.
Next Steps
- Deploying with Bun -- PM2, systemd, Nginx reverse proxy
- Deploying with Docker -- Docker Compose, Kubernetes, CI/CD
- Deploying to Vercel -- Edge functions, preview deployments
- Deploying to Cloudflare -- Workers and Pages