Skip to Content
Heels LogoHeelsDocs
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:

  1. PostgreSQL 16+: Persistent relational storage for users, projects, integrations, and event delivery logs.
  2. Redis 7+: In-memory broker for rate limiting and Redis Streams queues.
  3. service-api: Management API server (Port 8080).
  4. service-publisher: Public ingestion endpoint (Port 8081).
  5. service-worker: Outbound channel dispatcher.
  6. 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

VariableDescriptionDefault / Example
DATABASE_URLPostgreSQL connection stringpostgres://user:pass@localhost:5432/heels_db
REDIS_URLRedis connection URLredis://127.0.0.1:6379
JWT_SECRETSecret key used to sign JWT auth tokensrandom_long_string_32_chars
PORTHTTP port for the Rust Axum service8080 (API), 8081 (Publisher)
HOSTBind address0.0.0.0
RUST_LOGLogging 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 run

Then start the full stack:

docker compose up -d

Verify that all containers are healthy:

docker compose ps

On this page