# Self-host Temporal

> Durable workflow execution: write long-running business logic as code and let Temporal survive failures.

- Page: https://levelrail.com/templates/temporal/
- JSON: https://levelrail.com/templates/temporal.json
- Category: Automation
- Licence: MIT (Permissive license)
- Source: https://github.com/temporalio/temporal
- Upstream docs: https://docs.temporal.io

## Requirements
- Memory: about 1 GiB
- amd64: published, arm64: published
- Needs configuration before start: no
- Pinned image tag: 16-alpine

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| db | postgres | 16-alpine | none | temporal_db_data -> /var/lib/postgresql/data |
| temporal | temporalio/auto-setup | 1.29.7 | 7233 | none |
| temporal-ui | temporalio/ui | 2.54.1 | 8080 | none |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| db | POSTGRES_DB | preset |
| db | POSTGRES_PASSWORD | generated |
| db | POSTGRES_USER | preset |
| temporal | DB | preset |
| temporal | DB_PORT | preset |
| temporal | POSTGRES_PWD | generated |
| temporal | POSTGRES_SEEDS | preset |
| temporal | POSTGRES_USER | preset |
| temporal-ui | TEMPORAL_ADDRESS | preset |

## Deploy

### CLI

```bash
levelrail-cli templates deploy temporal --name my-temporal
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/temporal/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## Questions

### Can I deploy Temporal on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for Temporal, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image postgres:16-alpine, temporalio/auto-setup:1.29.7, temporalio/ui:2.54.1 is what you deploy there.

Self-host Temporal, Temporal docker compose file, deploy Temporal on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
