Tutorial

Automation

Installing Temporal on a VPS: self-hosted automation

Temporal is a durable workflow orchestration engine: your long-running processes survive restarts, outages and errors, because their state is persisted at every step. Designed for developers through SDKs (Go, Java, Python, TypeScript), it is ideal for complex transactions and sagas. Here's how to install it self-hosted on a VPS.

10 min read10 steps
Contents· Why self-host Temporal on a VPS1/11
  1. 01Why self-host Temporal on a VPS
  2. 02Temporal use cases
  3. 03Architecture of self-hosted Temporal
  4. 04Temporal vs BullMQ vs Celery
  5. 05Technical prerequisites
  6. 06Deploy Temporal with Docker Compose
  7. 07Configure a simple Go or TypeScript Worker
  8. 08Temporal UI — monitor and debug workflows
  9. 09PostgreSQL backups and persistence
  10. 10Troubleshooting — common errors
  11. 11Security: do not expose Frontend Service without authentication

Why self-host Temporal on a VPS

Temporal Cloud exists, but self-hosting remains relevant for several reasons. Cost: starting from 99 DH/month, a ServOrbit VPS is sufficient for moderate workloads, without per-action or active workflow fees. Data sovereignty: your workflows may process sensitive information that must not pass through a third-party service. Flexibility: you control the deployed version, retention policies and internal network integrations.

Temporal use cases

Temporal shines where cron jobs and simple queues show their limits. Here are the most common production use cases.

Architecture of self-hosted Temporal

Understanding the internal components helps you size your VPS and diagnose issues. Temporal consists of four main services that can run in the same process (temporalio/auto-setup) or be deployed separately at scale.

Temporal vs BullMQ vs Celery

Scroll the table

CriterionTemporalBullMQCelery
State durabilityFull history persisted in database — an interrupted workflow resumes exactly where it left offState in Redis — a Redis loss means job lossOptional results backend — no native execution history
Replay and determinismAutomatic replay from history — workflow code must be deterministic, Temporal handles the restNo native replay — simple retry on failurePer-task configurable retry, no multi-step workflow replay
Observation UIRich built-in UI: workflow list, step detail, search, manual actionsBull Board as third-party plugin — functional but limitedFlower as separate tool — basic metrics, no step history
Supported languagesGo, TypeScript/JavaScript, Python, Java, ‎.NET, PHP (official SDKs)Node.js onlyPrimarily Python
Performance and latencyHigher overhead per task — optimized for durability over low latencyVery low latency — designed for high-frequency job queuesVariable latency depending on broker
Ideal use caseLong critical business workflows, saga pattern, multi-step processes over daysHigh-frequency task queues, image processing, real-time notificationsPython background tasks, data pipelines, existing Python ecosystem

Technical prerequisites

Before starting, verify your environment is ready.

Deploy Temporal with Docker Compose

  1. Create the working directory

    Create a dedicated directory and navigate into it.

    mkdir -p /opt/temporal && cd /opt/temporal
  2. Download the official Docker Compose file

    Temporal provides a reference Compose file in its GitHub repository.

    curl -L https://raw.githubusercontent.com/temporalio/docker-compose/main/docker-compose-postgres.yml -o docker-compose.yml
  3. Create the environment variables file

    Create a .env file to customize PostgreSQL credentials. Never leave default passwords in production.

    chmod 600 .env
  4. Restrict .env file permissions

    The .env file contains credentials — restrict access.

    chmod 600 .env
  5. Start the Temporal stack

    Launch all services in the background. First startup takes a few minutes as auto-setup initializes the PostgreSQL schema.

    docker compose up -d
  6. Verify all services are healthy

    Wait 60-90 seconds, then check that containers are in healthy or running state.

    docker compose ps
  7. Verify connection to the Frontend Service

    Confirm the server responds on the gRPC port.

    docker exec temporal-admin-tools temporal operator cluster health
  8. Create a production namespace

    Create a dedicated namespace for your application with a 30-day retention.

    docker exec temporal-admin-tools temporal operator namespace create --retention 30d myapp
  9. Access the Temporal UI

    The web interface is available on port 8080.

    curl -s http://localhost:8080 | grep -o '<title>[^<]*</title>'
  10. Configure automatic startup

    Enable Docker at VPS boot. Containers only come back with it if the Compose file gives them a restart policy (for example restart: unless-stopped): check it with grep -n restart docker-compose.yml.

    systemctl enable docker

Configure a simple Go or TypeScript Worker

A Worker is the process that actually executes your business code. It connects to the Frontend Service, polls a task queue and executes the Workflows and Activities that Temporal dispatches to it.

Temporal UI — monitor and debug workflows

The Temporal UI (available on port 8080) is the central tool for observing your workflows in production.

PostgreSQL backups and persistence

Temporal's durability relies entirely on PostgreSQL. An unbackedup instance means total history loss on VPS failure.

Troubleshooting — common errors

Here are the four most common errors when installing Temporal on a VPS and their resolution.

Security: do not expose Frontend Service without authentication

Port 7233 (gRPC Frontend) and port 8080 (UI) must never be exposed directly to the Internet. Recommended measures: (1) block port 7233 in ufw and allow only your Workers' IPs; (2) place the UI behind an nginx reverse proxy with HTTP basic auth or SSO; (3) use a VPN or private network between your Temporal VPS and Worker VPS. In production, consider mTLS (available in Temporal v1.x) to encrypt and authenticate gRPC connections.

A VPS infrastructure for Temporal

Temporal demands solid resources: the ServOrbit Cloud VPS provides the necessary vCPU, RAM and fast disk, with Docker ready to use and automatic SSL to secure the Web UI. Launch your durable orchestration self-hosted.