Prerequisites
- Docker v24 or later
- Docker Compose v2 or later (included with Docker Desktop)
Setup
Create your docker-compose.yml
Create a Service summary:
docker-compose.yml file with the following services:docker-compose.yml
| Service | Image | Purpose | Port(s) |
|---|---|---|---|
postgres | postgres:15.6 | Primary data store | 5435 → 5432 |
rabbitmq | rabbitmq:4-management | Message queue | 5673 → 5672, 15673 → 15672 |
migration | ghcr.io/.../hatchet-migrate:latest | Runs database migrations (one-shot) | — |
setup-config | ghcr.io/.../hatchet-admin:latest | Generates server config (one-shot) | — |
hatchet-engine | ghcr.io/.../hatchet-engine:latest | gRPC engine for task scheduling | 7077 → 7070 |
hatchet-dashboard | ghcr.io/.../hatchet-dashboard:latest | REST API + web dashboard | 8080 → 80 |
Start the stack
Run the following command from the directory containing your Docker Compose will:
docker-compose.yml:- Start PostgreSQL and RabbitMQ and wait for their health checks to pass
- Run database migrations
- Generate the server configuration
- Start the Hatchet engine and dashboard
hatchet-engine and hatchet-dashboard before proceeding.Access the dashboard
Create an API token
You need an API token to connect your workers and application code to Hatchet. There are two ways to create one:From the dashboard:Store the token securely — it will not be shown again.
- Log in and navigate to Settings.
- Click the API Tokens tab.
- Click Create API Token and copy the token.
Connect your SDK
Set the following environment variables in your worker and application processes:The SDK reads both variables automatically. See the quickstart for a full example of defining tasks and running workers.
Updating to the latest version
The compose file above useslatest tags. To pull the latest images:
Running your worker inside Docker Compose
If your worker process also runs inside the same Docker Compose network, update theSERVER_GRPC_BROADCAST_ADDRESS in the setup-config service to use the container hostname instead of localhost:
docker-compose.yml
docker-compose.yml
Changing
SERVER_GRPC_BROADCAST_ADDRESS invalidates any previously issued API
tokens. Re-run the token creation step after making this change.Using Postgres as the message queue
RabbitMQ is optional. To use Postgres-backed messaging instead, set the following environment variable in thesetup-config and hatchet-engine services, and remove all rabbitmq references from the compose file:
Optional: observability stack
The repository includes a separatedocker-compose.infra.yml with Prometheus, Grafana, and HyperDX for metrics and tracing:
| Service | Port |
|---|---|
| Prometheus | 9091 → 9090 |
| Grafana | 3001 → 3000 |
| HyperDX UI | 8081 → 8080 |