These docker-compose files enable you to run a local instance of the Temporal Server. There are a variety of docker-compose files, each utilizing a different set of dependencies.
To use these files, you must first have the following installed:
- Docker (includes Docker Compose)
The following steps will run a local instance of the Temporal Server using the default configuration file (docker-compose.yml):
- Clone this repository.
- Change directory into the
composefolder. - Run the
docker compose upcommand.
git clone https://github.com/temporalio/samples-server.git
cd samples-server/compose
docker compose upAfter the Server has started, you can open the Temporal Web UI in your browser: http://localhost:8080.
To stop and remove containers and volumes:
docker compose down -vYou can also interact with the Server using the Temporal CLI.
To install the Temporal CLI:
# macOS (Homebrew)
brew install temporal
# Other platforms - see https://docs.temporal.io/cli#installThe following is an example of how to create a new namespace test-namespace with 1 day of retention:
temporal operator namespace create --namespace test-namespace --retention 1dGet started building Workflows with the SDK samples:
For the most up-to-date SDK references, see https://docs.temporal.io/develop.
The default configuration file (docker-compose.yml) uses a PostgreSQL database, an Elasticsearch instance, and exposes the Temporal gRPC Frontend on port 7233.
The other configuration files in the repo spin up instances of the Temporal Server using different databases and dependencies.
For example you can run the Temporal Server with MySQL and Elasticsearch with this command:
docker compose -f docker-compose-mysql-es.yml upHere is a list of available files and the dependencies they use.
| File | Description |
|---|---|
| docker-compose-dev.yml | Development server with local file storage (UI on port 8233) |
| docker-compose.yml | PostgreSQL and Elasticsearch (default) |
| docker-compose-tls.yml | PostgreSQL and Elasticsearch with TLS |
| docker-compose-postgres.yml | PostgreSQL |
| docker-compose-cass-es.yml | Cassandra and Elasticsearch |
| docker-compose-mysql.yml | MySQL |
| docker-compose-mysql-es.yml | MySQL and Elasticsearch |
| docker-compose-postgres-opensearch.yml | PostgreSQL and OpenSearch |
| docker-compose-multirole.yaml | PostgreSQL and Elasticsearch with multi-role Server containers |
The docker-compose-multirole.yaml configuration runs each Temporal service separately and includes Prometheus and Grafana with Server and SDK dashboards.
First install the Loki plugin (this is a one-time operation)
docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissionsStart multi-role Server configuration:
docker compose -f docker-compose-multirole.yaml up
Some exposed endpoints:
- http://localhost:8080 - Temporal Web UI
- http://localhost:8085 - Grafana dashboards
- http://localhost:9090 - Prometheus UI
- http://localhost:9090/targets - Prometheus targets
- http://localhost:8000/metrics - Server metrics
These docker-compose setups are intended for local development and testing. For production deployments:
- Kubernetes: Use the Temporal Helm Charts repository
- Schema setup: Reference the setup scripts in this repository for database schema initialization examples
The Temporal Server uses a base configuration template that defines the structure for persistence, visibility, and other settings. These templates use Sprig for templating, which provides functions for string manipulation, environment variable access, and more.
Pre-v1.30 (external template):
- Configuration template:
docker/config_template.yaml - The template is stored as a separate file in the Docker image
- Environment variables are substituted into this template at runtime
v1.30 and later (embedded template):
- Configuration template:
common/config/config_template_embedded.yaml - The template is embedded directly in the server binary
- More efficient and reduces dependencies on external files
- Environment variable substitution works the same way
The docker-compose files in this repository work with both pre-v1.30 and v1.30+ server versions. The main differences are:
- Admin tools: v1.30+ includes improved tooling like
temporal-elasticsearch-tooland enhancedtemporal-cassandra-toolcommands - Configuration: v1.30+ uses the embedded template, but accepts the same environment variables
- Schema management: Setup scripts detect and use new tools when available, with fallback to legacy methods
For customizing server configuration beyond environment variables, refer to the appropriate template file for your server version.