logo
Install and configureDocker Compose
Install and configure

Install with Docker Compose

Run SlugBase from docker-compose.example.yml: ports, env file, SQLite volume, and optional PostgreSQL.

What you need

  • Docker and Docker Compose v2.
  • A copy of the SlugBase repository or at least its Dockerfile and docker-compose.example.yml.
  • An .env file with production secrets and URLs — see Configuration.

The repository ships docker-compose.example.yml as the template. Copy it to docker-compose.yml and adjust values for your environment (the project README describes this pattern).

Steps

Copy the Compose template

cp docker-compose.example.yml docker-compose.yml

Create .env and data directory

Add at least JWT_SECRET, ENCRYPTION_KEY, and SESSION_SECRET (production length requirements apply). Set BASE_URL and FRONTEND_URL to your public site URL when deploying behind a domain.

mkdir -p ./data

The example compose file mounts ./data to /app/data so the SQLite file survives container restarts.

Start the stack

docker compose up -d

The example service:

  • Builds from the root Dockerfile when you use build: . (or pulls slugbase/slugbase:latest if you point image there instead).
  • Publishes ${PORT:-5000}:5000.
  • Loads env_file: .env.
  • Sets DB_PATH=/app/data/slugbase.db inside the container.
  • Defines a healthcheck against /api/health like the Dockerfile.

Open the app

Visit http://localhost:5000 (or your host and mapped port). Complete First run setup when the database is new.

Optional PostgreSQL

The same example file contains a commented slugbase-postgres service and notes for switching the app service to DB_TYPE=postgresql with a dependency on Postgres health. Uncomment and wire credentials to match your .env when you outgrow SQLite or need a remote database.

# slugbase-postgres:
#   image: postgres:16-alpine
#   environment:
#     - POSTGRES_DB=${DB_NAME:-slugbase}
#     - POSTGRES_USER=${DB_USER:-slugbase}
#     - POSTGRES_PASSWORD=${DB_PASSWORD:-change-this-password}
#   volumes:
#     - postgres-data:/var/lib/postgresql/data

Verify

CheckExpected
docker compose psService healthy after start period.
BrowserInitial Setup or login at your base URL.
LogsNo repeated crash loops; address validation errors if secrets are missing.

Troubleshooting