Complete instructions for deploying OFFER-HUB Orchestrator on your own infrastructure using Docker.
Run OFFER-HUB Orchestrator on your own server with full control over data, uptime, and configuration. This guide covers everything from initial setup to ongoing maintenance using Docker.
Tip
If you haven't configured your environment variables yet, review the Configuration page first.
Prerequisites
Before you begin, make sure your host machine meets the following requirements:
Docker v20.10 or later
Docker Compose v2.0 or later
PostgreSQL 15+ (or managed service like Supabase, Neon, Railway)
Redis 7+ (or managed service like Upstash, Railway)
A registered domain name (recommended for production)
At least 2 GB of RAM and 20 GB of disk space
Verify that Docker is installed and running:
Terminal
$ docker --version && docker compose version
Note
On older installations you may need to use docker-compose (with a hyphen) instead of docker compose.
Architecture Overview
The repository's root Compose file starts only the infrastructure dependencies. The API is built and
run from the repository separately:
Mermaid
Rendering diagram…
The API runs alongside PostgreSQL and Redis, and connects to the Stellar network.
The topology is verified against the Orchestrator root docker-compose.yml, apps/api/src/main.ts, and apps/api/src/modules/webhooks/webhooks.controller.ts: Compose provides PostgreSQL and Redis while the API hosts both REST endpoints and inbound webhook handling.
Docker Setup
Project Structure
Create a deployment directory:
Terminal
$ mkdir offer-hub-deploy && cd offer-hub-deploy
Your directory will contain:
typescript
offer-hub-deploy/├── docker-compose.yml├── .env├── nginx.conf (optional)└── certs/ (optional, for TLS)
This Compose file provides PostgreSQL and Redis only. Run the API from the repository with the
commands below, or deploy it with a build-based platform configuration.
Using External Services
If you prefer managed databases, remove postgres and redis services and update the environment:
To understand exactly what gets created — every table, field, and relationship — see the Data Model reference.
Warning
Always back up your database before running migrations in production.
Setting NODE_ENV
Make sure NODE_ENV=production is set in your .env file. This enables:
Optimised builds and minification
Stricter error handling
Disabled development-only logging
Production-level security defaults
TLS / HTTPS
For production deployments you should terminate TLS at your hosting platform or an external reverse proxy. The dependency Compose file does not include an application or proxy service.
The Orchestrator exposes a /health endpoint that returns the current service status. The Docker Compose file already configures a health check against it.
This starts or updates the PostgreSQL and Redis dependencies. Rebuild and restart the API separately.
Full Update Workflow
The recommended update procedure:
Back up your database before any update.
Pull the latest source.
Run migrations.
Rebuild and restart the API.
bash
# 1. Backup databasedocker compose exec postgres pg_dump -U offerhub offerhub_db > backup-$(date +%Y%m%d).sql# 2. Pull the latest sourcegit pull --ff-only# 3. Rebuild the APInpm ci && npm run build# 4. Run any new migrationsnpx prisma migrate deploy --schema packages/database/prisma/schema.prisma# 5. Verify healthcurl http://localhost:4000/api/v1/health
Rolling Back
If something goes wrong, roll back the source checkout to a known-good commit:
bash
git log --oneline -10git checkout <known-good-commit>npm ci && npm run build
Then restart the API:
Terminal
$ npm start -w @offerhub/api
Security Checklist
Before going to production, verify:
NODE_ENV=production is set
OFFERHUB_MASTER_KEY is a strong, unique value
WALLET_ENCRYPTION_KEY is backed up securely
Database uses SSL (?sslmode=require)
Redis uses TLS (rediss://)
HTTPS is enabled with valid certificates
Firewall only exposes ports 80/443
Database is not publicly accessible
Redis is not publicly accessible
Inbound webhook secrets are configured (AIRTM_WEBHOOK_SECRET / TRUSTLESS_WEBHOOK_SECRET)
Troubleshooting
API won't start
bash
# Check logsnpm start -w @offerhub/api# Common issues:# - DATABASE_URL invalid# - WALLET_ENCRYPTION_KEY wrong length# - Redis not reachable
Database connection errors
bash
# Test PostgreSQL connectionnpx prisma db pull --schema packages/database/prisma/schema.prisma# Check if migrations are appliednpx prisma migrate status --schema packages/database/prisma/schema.prisma
Inbound provider webhooks not being processed
bash
# Check the inbound webhook queuedocker compose exec redis redis-cli lrange "bull:webhooks:failed" 0 10# Common issues:# - AIRTM_WEBHOOK_SECRET / TRUSTLESS_WEBHOOK_SECRET don't match the provider's configured secret# - The provider can't reach POST /api/v1/webhooks/airtm or /api/v1/webhooks/trustless-work# (PUBLIC_BASE_URL wrong, firewall, or TLS misconfiguration)