Run GrowthBook with Docker
The fastest way to run GrowthBook locally is with Docker Compose. The Compose stack below starts GrowthBook and a MongoDB instance together — no manual database wiring required.
Step-by-step walkthrough
Section titled “Step-by-step walkthrough”-
Save the compose.yaml shown in the box above to your project root. The file defines two services —
mongoandgrowthbook— and one named volume for file uploads. -
Start GrowthBook in the background by running:
docker compose up -dThe -d flag (detached mode) returns control to your terminal immediately while both containers start in the background.
-
Open your browser at
http://localhost:3000— this is the GrowthBook web UI where you create feature flags, run experiments, and manage your account. -
Your SDK will talk to
http://localhost:3100— this is the GrowthBook SDK API endpoint. Your application fetches feature flag payloads from this URL, not from port 3000. -
Stop and inspect the stack when you are done:
# Stop all containers (data is preserved in the uploads volume)docker compose down
# Tail live logs for the growthbook container onlydocker compose logs -f growthbookFull compose.yaml reference
Section titled “Full compose.yaml reference”services: mongo: image: mongo:latest environment: - MONGO_INITDB_ROOT_USERNAME=root - MONGO_INITDB_ROOT_PASSWORD=password growthbook: image: growthbook/growthbook:latest ports: ["3000:3000", "3100:3100"] depends_on: [mongo] environment: - MONGO_URL=mongodb://root:password@mongo:27017/ volumes: ["uploads:/usr/local/src/app/packages/back-end/uploads"]volumes: uploads:Port reference
Section titled “Port reference”| Port | Service | Purpose |
|---|---|---|
| 3000 | GrowthBook web app | Admin UI — create flags, experiments, metrics |
| 3100 | GrowthBook SDK API | Your application fetches feature flags from here |
| 27017 | MongoDB (internal) | Not exposed to the host; only used by the GrowthBook container |
About MongoDB
Section titled “About MongoDB”GrowthBook stores all of its own configuration in MongoDB — feature flag definitions, experiment configs, metrics, and team settings. MongoDB does not hold your analytics event data or your user data warehouse. Your raw events stay wherever they already live (Snowflake, BigQuery, Redshift, etc.).
# Start GrowthBook and MongoDB in the background
docker compose up -d
# Stop all containers (data is preserved)
docker compose down
# Tail live logs for the growthbook container
docker compose logs -f growthbook