Hookdeck, Svix, and similar products persist events in a vendor queue you never see. Webhook Router writes the same rows to app.db next to Compose. Signing secrets stay in an env file. Retries are SQL, not a dashboard you rent.
Path of one event
01
Ingest
TLS at Caddy. POST /hooks/{source}. Body never leaves the box.
02
Verify
Stripe or HMAC. Failed signatures return 400 with no INSERT.
03
Enqueue
One SQLite transaction: events row plus N deliveries in WAL.
04
Deliver
Workers claim rows, retry on next_at, dead-letter on disk.
Production Docker Compose
mem_limit 50m matches the RSS budget. WAL files live on the bind mount so a restart does not drop the queue.
services:
webhook-router:
image: webhook-router:latest
restart: unless-stopped
mem_limit: 50m
memswap_limit: 50m
cpus: "0.50"
ports:
- "127.0.0.1:8090:8090"
environment:
TZ: Europe/Madrid
NEXUS_TELEMETRY: "off"
SQLITE_JOURNAL: WAL
SQLITE_BUSY_TIMEOUT_MS: "5000"
SQLITE_CACHE_KB: "8192"
MAX_RSS_MB: "48"
STRIPE_WEBHOOK_SECRET: ${STRIPE_WEBHOOK_SECRET}
volumes:
- ./data/webhooks:/var/lib/webhook-router
- ./routes.json:/app/routes.json:ro
- ./router.env:/run/secrets/env:ro
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8090/health"]
interval: 15s
timeout: 3s
retries: 5SQLite schema
Three tables. No broker. Back up ./data/webhooks with the rest of the host.
-- /var/lib/webhook-router/app.db (WAL) CREATE TABLE events ( id TEXT PRIMARY KEY, source TEXT NOT NULL, received_at INTEGER NOT NULL, payload BLOB NOT NULL, verified INTEGER NOT NULL DEFAULT 1 ); CREATE TABLE deliveries ( id INTEGER PRIMARY KEY, event_id TEXT NOT NULL, dest TEXT NOT NULL, attempt INTEGER NOT NULL, status TEXT NOT NULL, -- queued | retrying | ok | dead next_at INTEGER, last_error TEXT ); CREATE TABLE dead_letter ( id INTEGER PRIMARY KEY, event_id TEXT NOT NULL, dest TEXT NOT NULL, failed_at INTEGER NOT NULL, last_error TEXT );
Resource usage (under 50MB RAM)
Measured on a 1 vCPU / 1 GB VPS with WAL on SSD after 10k Stripe-sized events.
# RSS after 10k Stripe-sized events, WAL on SSD # webhook-router 38–46 MB RSS # sqlite WAL ~2 MB mapped # idle CPU <1% of 1 vCPU # p95 ingest 4–9 ms local # p95 fan-out destination-bound
Related: Replace cloud webhook services and self-hosted webhook router setup.
Get the source
Webhook Router ships in both bundles. Checkout stays on Whop.
