Skip to main content

Deployment

The main torq repository includes a complete setup for running torq on a small Linux VPS with automatic deployments on every push, HTTPS via Cloudflare Tunnel, and zero open web ports. This page summarizes the setup from docs/deployment.md.

Architecture & pipeline​

Images report their version from git describe (for example v1.12.0-2-gabc1234 for commits after a release). A release tag (v1.12.0) runs the same checks and updates :latest and :1.12.0. Release candidates (v1.11.0-rc.1) publish :preview without touching :latest.

Components​

ComponentDetails
ServerAny small Linux VPS with Docker (e.g. Hetzner Cloud CAX11 ARM, ~€4/month, Ubuntu 24.04). Only inbound TCP 22 (SSH) is needed; ports 80 and 443 stay closed.
HTTPS & domainA Cloudflare Tunnel (cloudflared) connects outward from the VPS to Cloudflare — no open web ports and no TLS certificates to manage. Optionally add Cloudflare Zero Trust → Access for an extra email OTP gate.
Stackdeploy/docker-compose.yml runs torq and cloudflared; settings live in /opt/torq/torq.env from deploy/env.example.
CI/CDGitHub Actions runs the deploy job when the repository variable DEPLOY_HOST is set, using DEPLOY_USER, DEPLOY_SSH_KEY, and DEPLOY_KNOWN_HOSTS.

Setup summary​

  1. Create the server: Provision an arm64 or amd64 Linux VPS, enable provider disk backups, and allow only SSH (TCP 22) in the firewall.
  2. Prepare Docker & deploy user: Install Docker Engine + Compose plugin, create a deploy user in the docker group with /opt/torq, and authorize a dedicated ed25519 deploy key.
  3. Create a Cloudflare Tunnel: In Cloudflare Zero Trust → Networks → Tunnels, create a cloudflared tunnel, copy its token, and point your public hostname (e.g. torq.example.com) to HTTP torq:8080.
  4. Configure /opt/torq/torq.env: Copy deploy/env.example to /opt/torq/torq.env (chmod 600) and set TORQ_BASE_URL, TZ, and your tunnel token.
  5. Connect GitHub Actions: Set repository variable DEPLOY_HOST (and optionally DEPLOY_USER) plus secrets DEPLOY_SSH_KEY and DEPLOY_KNOWN_HOSTS under Settings → Secrets and variables → Actions.
  6. First start: Push to main (or trigger the workflow). Once healthy, open https://torq.example.com and create the administrator account immediately.

Day-to-day operations & rollbacks​

ssh deploy@<server-ip>
cd /opt/torq
docker compose ps # status and health
docker compose logs -f torq # application logs
docker compose restart torq

Every image is tagged with its commit SHA, so rolling back takes one command:

cd /opt/torq
echo "TORQ_IMAGE=ghcr.io/<owner>/torq:sha-<commit>" > .env
docker compose up -d
Forward-only schema migrations

Database migrations only move forward. Before each upgrade, torq automatically copies the database to /data/backups/. If an older container refuses a newer database schema, restore the matching pre-upgrade backup from /data/backups/ (or a server snapshot). See Data and backups.

Using your own reverse proxy instead?

You don't have to use Cloudflare Tunnel or the CI/CD pipeline. Run ghcr.io/app-torq/torq:latest anywhere Docker runs and place Caddy, Nginx, or Traefik in front of it — see Installation.