VPS Deployment (Compose + systemd)
Purpose
Run Orloj on a single VPS with Docker Compose managed by systemd for automatic restart and reboot recovery.
Prerequisites
- Linux VPS with systemd (for example Ubuntu 22.04+)
- Docker Engine with Compose plugin
git,curl, andjq- sudo access
Install
1. Place Repository on Host
sudo mkdir -p /opt/orloj
sudo chown "$USER":"$USER" /opt/orloj
git clone https://github.com/OrlojHQ/orloj.git /opt/orloj
cd /opt/orloj2. Configure Runtime Variables
cp docs/deploy/vps/.env.vps.example docs/deploy/vps/.env.vpsEdit docs/deploy/vps/.env.vps and rotate at minimum:
POSTGRES_PASSWORDORLOJ_POSTGRES_DSNpassword componentORLOJ_MODEL_GATEWAY_PROVIDERand key if not using mock
3. Validate Compose Config
docker compose --env-file docs/deploy/vps/.env.vps -f docs/deploy/vps/docker-compose.vps.yml config4. Install systemd Unit
sudo cp docs/deploy/vps/orloj-compose.service /etc/systemd/system/orloj.service
sudo systemctl daemon-reload
sudo systemctl enable --now orlojVerify
Service status:
sudo systemctl status orloj --no-pagerStack and health checks:
docker compose --env-file docs/deploy/vps/.env.vps -f docs/deploy/vps/docker-compose.vps.yml ps
curl -s http://127.0.0.1:8080/healthz | jq .
go run ./cmd/orlojctl get workersSample task execution:
go run ./cmd/orlojctl apply -f examples/blueprints/pipeline/
go run ./cmd/orlojctl get task bp-pipeline-taskDone means:
orlojsystemd unit is active.- stack survives restart (
sudo systemctl restart orloj). - health and worker checks pass.
- sample task reaches
Succeeded.
Operate
Restart stack:
sudo systemctl restart orlojTail service logs:
sudo journalctl -u orloj -fTail compose logs:
docker compose --env-file docs/deploy/vps/.env.vps -f docs/deploy/vps/docker-compose.vps.yml logs -fUpgrade flow:
git pullin/opt/orloj.sudo systemctl reload orloj.- rerun verification checks.
Troubleshoot
docker compose ... configfails: fix missing/invalid.env.vpsvalues.- systemd start fails: verify docker binary path and service logs (
journalctl -u orloj). - workers absent: verify
ORLOJ_AGENT_MESSAGE_CONSUME=trueand message-bus settings.
Security Defaults
- This is a single-node baseline, not HA.
- Bind or firewall
8080to trusted networks only. - API auth defaults to
ORLOJ_AUTH_MODE=native; complete/ui/setupon first boot. - Generate and rotate an API token (
openssl rand -hex 32), setORLOJ_API_TOKENon the server, and reuse the same value for CLI/automation—see Control plane API tokens.