Deployment
Deploy OpenFlags to production with Docker in one command.
Deployment
OpenFlags ships as a single, all-in-one Docker image. One container serves both the API and the Dashboard on the same port — no nginx, no reverse proxy configuration needed.
Quick start (Docker Hub)
docker run -d \
--name openflags \
-p 4000:4000 \
-v openflags_data:/app/data \
-e CORS_ORIGIN=https://flags.yourcompany.com \
huextrat/openflags:latestOpen http://localhost:4000 — the first user to sign up becomes Platform Admin.
Docker Compose
Create a docker-compose.yml anywhere on your server:
services:
openflags:
image: huextrat/openflags:latest
ports:
- "4000:4000"
volumes:
- openflags_data:/app/data
environment:
PORT: 4000
CORS_ORIGIN: https://flags.yourcompany.com
restart: unless-stopped
volumes:
openflags_data:docker compose up -dEnvironment variables
| Variable | Default | Description |
|---|---|---|
PORT | 4000 | Port the server listens on |
CORS_ORIGIN | http://localhost:4000 | Allowed origin for auth cookies — set to your public domain in production |
DASHBOARD_DIR | /app/public | Path to dashboard static files (pre-configured in the Docker image) |
DATA_DIR | /app/data | SQLite database directory — mount a volume here to persist data |
Build from source
If you prefer to build the image yourself:
git clone https://github.com/huextrat/openflags.git
cd openflags
docker build -f infra/docker/Dockerfile -t openflags .
docker run -d -p 4000:4000 -v openflags_data:/app/data openflagsMulti-container setup
The repository also includes separate Dockerfiles for running the server and dashboard independently behind nginx. This is useful for teams that want to scale or deploy each component separately:
docker compose up -d # uses docker-compose.yml at repo rootThis starts:
- Server on port
4000 - Dashboard + nginx on port
8080(proxies/api/→ server)
Hosting the docs site
The documentation lives in apps/docs and is a standalone Next.js application. Deploy it to Vercel for the best experience:
- Connect your GitHub repository to Vercel.
- Set the root directory to
apps/docs. - Vercel auto-detects Next.js + Turborepo — deploy takes ~1 minute.
Production checklist
- Set
CORS_ORIGINto your actual domain (e.g.https://flags.yourcompany.com) - Mount a persistent volume for
/app/dataso your SQLite database survives restarts - Place OpenFlags behind a reverse proxy (Caddy, Traefik, nginx) for SSL termination
- Use a custom domain with HTTPS for cookie security