Installation
From zero to first lifecycle email in under 5 minutes. Deploy the template, run the CLI, done.
Prerequisites
- Railway account — sign up here
- PostHog account with a personal API key — generate one at PostHog > Settings > Personal API Keys (starts with
phx_) - Resend account — sign up free, grab your API key
Deploy to Railway (1 click)
Click the button below to deploy the full Hogsend stack on Railway:
The template provisions everything:
- hogsend-api — the HTTP API
- hogsend-worker — Hatchet worker for durable journey execution
- Hatchet-Lite — workflow orchestration engine
- Postgres 18 — event store, journey state, contacts
- Postgres 16 — Hatchet's internal database
- Redis 8 — PostHog property caching
You'll be asked for two values during deploy:
| Variable | Where to find it |
|---|---|
RESEND_API_KEY | Resend dashboard → API Keys |
HATCHET_CLIENT_TOKEN | The Hatchet-Lite service generates this — check its logs after deploy, or use the default token from the Hatchet dashboard at localhost:8888 |
Railway auto-wires DATABASE_URL and REDIS_URL between services. Wait for the deploy to complete (~3 minutes).
Configure with the CLI
Install the Hogsend CLI:
# macOS (Apple Silicon)
curl -L https://github.com/dougwithseismic/hogsend/releases/latest/download/hogsend_darwin_arm64.tar.gz | tar xz
sudo mv hogsend /usr/local/bin/
# macOS (Intel)
curl -L https://github.com/dougwithseismic/hogsend/releases/latest/download/hogsend_darwin_amd64.tar.gz | tar xz
sudo mv hogsend /usr/local/bin/
# Linux (amd64)
curl -L https://github.com/dougwithseismic/hogsend/releases/latest/download/hogsend_linux_amd64.tar.gz | tar xz
sudo mv hogsend /usr/local/bin/Then run the interactive setup:
hogsend initThe CLI will:
- Connect to your Railway project and discover your services
- Connect to PostHog and list your projects
- Generate all secrets (
BETTER_AUTH_SECRET,POSTHOG_WEBHOOK_SECRET,ADMIN_API_KEY) - Set environment variables on your API and Worker services
- Create a PostHog webhook destination with the right URL, headers, and event matchers
- Redeploy your services
- Wait for the API to become healthy
- Fire a test event and verify the full pipeline works
You'll need:
- A Railway API token — generate at railway.com/account/tokens
- Your PostHog personal API key — the
phx_key from PostHog > Settings > Personal API Keys
Everything else is automatic.
Verify
# Check deployment health
hogsend status
# Fire a test event through the full pipeline
hogsend testThe test command sends a synthetic event to /v1/ingest/, waits for it to be stored, and confirms the pipeline is working end-to-end.
Write your first journey
You're ready. Head to Journeys to define your first lifecycle flow, or explore the example journeys that ship with the repo.
Local development (for contributors)
If you want to develop Hogsend locally instead of deploying to Railway:
1. Clone and install
git clone https://github.com/dougwithseismic/hogsend.git
cd hogsend
pnpm install2. Start infrastructure
docker compose up -dThis boots TimescaleDB (port 5434), Redis (port 6380), and Hatchet-Lite (dashboard at localhost:8888).
3. Configure environment
cp apps/api/.env.example apps/api/.envFill in BETTER_AUTH_SECRET (run openssl rand -hex 32), RESEND_API_KEY, POSTHOG_API_KEY, and POSTHOG_HOST.
4. Run migrations and start
cd packages/db && pnpm db:migrate && cd ../..
# Terminal 1: API server
pnpm dev
# Terminal 2: Hatchet worker
cd apps/api && hatchet worker devOr use the CLI shortcut:
hogsend setup # checks prereqs, starts Docker, installs deps, creates .env