Self-Hosting
Self-Hosting with Docker
Deploy the complete Heels stack on your own server or cloud cluster with Docker Compose.
Self-Hosting with Docker
Heels is 100% open-source and easy to host on your own virtual private server (Hetzner, DigitalOcean, AWS EC2) or Kubernetes cluster.
Architecture Stack
A self-hosted deployment requires:
- PostgreSQL 16+: Persistent relational storage for users, projects, integrations, and event delivery logs.
- Redis 7+: In-memory broker for rate limiting and Redis Streams queues.
service-api: Management API server (Port 8080).service-publisher: Public ingestion endpoint (Port 8081).service-worker: Outbound channel dispatcher.dashboard: Next.js management web application (Port 3000).
docker-compose.yml
Create a docker-compose.yml in your deployment directory:
version: '3.8'
services:
postgres:
image: postgres:16-alpine
container_name: heels-postgres
restart: always
environment:
POSTGRES_USER: heels_user
POSTGRES_PASSWORD: secret_password
POSTGRES_DB: heels_db
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
redis:
image: redis:7-alpine
container_name: heels-redis
restart: always
ports:
- "6379:6379"
volumes:
- redisdata:/data
service-api:
build:
context: .
dockerfile: Dockerfile
args:
BIN: service-api
container_name: heels-api
restart: always
depends_on:
- postgres
- redis
ports:
- "8080:8080"
environment:
DATABASE_URL: postgres://heels_user:secret_password@postgres:5432/heels_db
REDIS_URL: redis://redis:6379
JWT_SECRET: super_secret_jwt_random_string_change_me
PORT: 8080
service-publisher:
build:
context: .
dockerfile: Dockerfile
args:
BIN: service-publisher
container_name: heels-publisher
restart: always
depends_on:
- postgres
- redis
ports:
- "8081:8081"
environment:
DATABASE_URL: postgres://heels_user:secret_password@postgres:5432/heels_db
REDIS_URL: redis://redis:6379
PORT: 8081
service-worker:
build:
context: .
dockerfile: Dockerfile
args:
BIN: service-worker
container_name: heels-worker
restart: always
depends_on:
- postgres
- redis
environment:
DATABASE_URL: postgres://heels_user:secret_password@postgres:5432/heels_db
REDIS_URL: redis://redis:6379
CONCURRENCY: 10
dashboard:
build:
context: ./apps/dashboard
dockerfile: Dockerfile
container_name: heels-dashboard
restart: always
ports:
- "3000:3000"
environment:
NEXT_PUBLIC_API_URL: http://localhost:8080
NEXT_PUBLIC_PUBLISHER_URL: http://localhost:8081
volumes:
pgdata:
redisdata:Environment Variables Reference
| Variable | Description | Default / Example |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | postgres://user:pass@localhost:5432/heels_db |
REDIS_URL | Redis connection URL | redis://127.0.0.1:6379 |
JWT_SECRET | Secret key used to sign JWT auth tokens | random_long_string_32_chars |
PORT | HTTP port for the Rust Axum service | 8080 (API), 8081 (Publisher) |
HOST | Bind address | 0.0.0.0 |
RUST_LOG | Logging verbosity (info, debug, trace) | info,service_publisher=debug |
Database Migrations
Before launching services for the first time, apply the PostgreSQL schema migrations using the SQLx CLI or the built-in database initializer:
cargo install sqlx-cli --no-default-features --features rustls,postgres
cd heels_code/crates/db-lib
sqlx database create
sqlx migrate runThen start the full stack:
docker compose up -dVerify that all containers are healthy:
docker compose ps