Stack Setup
Pull the Dreamphase image, drop in the compose file, set your environment, and bring both containers up with a single command.
1. Pull the image set
The Dreamphase stack uses two container images: gestaltmind/dreamphase-selfhost and postgres:16-alpine. Pull them before bringing the stack up so you can verify the download succeeds independently of startup.
# Pull all images defined in your compose file
docker compose pull
2. Create your docker-compose.yml
Create a working directory for the stack and save the following file as docker-compose.yml. The Dreamphase server serves both the HTTP API and the bundled web UI on the same port, so the stack only needs two services: dreamphase and postgres.
services:
# Dreamphase Server - Go backend with embedded web UI
dreamphase:
image: gestaltmind/dreamphase-selfhost:latest
ports:
- "${API_PORT:-8543}:8080"
environment:
# IMPORTANT: Change API_KEY in production!
API_KEY: "${API_KEY:-changeme}"
DATABASE_URL: "postgres://${POSTGRES_USER:-dreamer}:${POSTGRES_PASSWORD:-secret}@postgres:5432/${POSTGRES_DB:-dreamphase}?sslmode=disable"
PORT: 8080
ENVIRONMENT: "${ENVIRONMENT:-production}"
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
# Database - PostgreSQL
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB:-dreamphase}
POSTGRES_USER: ${POSTGRES_USER:-dreamer}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-secret}
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- pg_data:/var/lib/postgresql/data
ports:
- "${POSTGRES_PORT:-5432}:5432"
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-dreamer} -d ${POSTGRES_DB:-dreamphase}"]
interval: 10s
timeout: 5s
retries: 5
volumes:
pg_data:
Named volumes keep your data safe
The volumes block at the bottom of the file tells Docker to manage the data directories as named volumes. They survive container restarts and docker compose down. Use docker compose down -v only if you want to wipe the data completely.
3. Set environment variables
Create a .env file in the same directory as your docker-compose.yml. This file holds credentials and configuration values that both containers share. See the Configuration page for the full variable reference.
4. Start the stack
With the compose file and .env in place, bring both containers up in detached mode:
docker compose up -d
5. Verify the setup
Check that both services are running and healthy:
# Show the status of all services
docker compose ps
# Follow live logs across all containers
docker compose logs -f
Both services (dreamphase, postgres) should show a running state. If either container exits immediately, check the logs with docker compose logs <service> and refer to the Troubleshooting page.