---
title: "Deploy Hogsend - Lifecycle Email Automation"
description: "Code-first lifecycle email for scrappy product engineers, self-hosted."
category: "Other"
url: https://railway.com/deploy/hogsend-posthog-audience-stack
---

# Deploy Hogsend - Lifecycle Email Automation

Code-first lifecycle email for scrappy product engineers, self-hosted.

**[Deploy Hogsend - Lifecycle Email Automation on Railway](https://railway.com/template/hogsend-posthog-audience-stack)**

- **Creator:** withSeismic
- **Category:** Other

## Template content

### hogsend-api

- **Source:** https://github.com/dougwithseismic/hogsend
- **Public domain:** Yes

### hatchet-lite https://avatars.githubusercontent.com/u/118301880?.png

- **Image:** ghcr.io/hatchet-dev/hatchet/hatchet-lite:latest
- **Public domain:** Yes

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2.1
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### hogsend-worker

- **Source:** https://github.com/dougwithseismic/hogsend
- **Start command:** `pnpm --filter @hogsend/api worker`

### Postgres-J_tJ https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:16

## Documentation

# Deploy and Host Hogsend - Posthog Audience Stack on Railway

Hogsend is code-first lifecycle email automation for teams on PostHog + Resend. You define journeys as TypeScript — welcome series, trial nudges, churn recovery — triggered by your PostHog events and sent via Resend, with link/open tracking and one-click unsubscribe built in. This template self-hosts the whole stack on your own Railway project.

## About Hosting Hogsend - Posthog Audience Stack

The template provisions six pre-wired services: an HTTP api (ingestion, auth, the data plane), a worker that runs your durable journeys and sends email, Postgres (TimescaleDB) for the event store and contacts, Redis for the PostHog property cache, and a self-hosted hatchet-lite workflow engine with its own Postgres. Database, Redis, the auth secret, and public URLs are wired automatically. You provide a RESEND_API_KEY, and — once hatchet-lite boots — a HATCHET_CLIENT_TOKEN minted from its dashboard. The worker inherits both from the api, so you set them once, then redeploy.

## Common Use Cases

- Lifecycle email for a PostHog-instrumented product: welcome, activation, and onboarding sequences defined in code
- Trial-to-paid nudges and failed-payment / churn-recovery journeys
- Behavioral + transactional email via Resend, with open/click engagement fanned back out to PostHog, Segment, or Slack

## Dependencies for Hogsend - Posthog Audience Stack Hosting

- A Resend account and API key for email delivery
- A PostHog project as the event source (the primary use case; optional)

### Deployment Dependencies

- Hogsend docs: https://docs.hogsend.com
- Resend: https://resend.com
- PostHog: https://posthog.com
- Hatchet: https://hatchet.run

### Implementation Details 

After deploy, point a PostHog webhook at https://your-api/v1/webhooks/posthog and edit your journeys in TypeScript under src/journeys/. Mint the Hatchet token from the hatchet-lite dashboard (Settings, API Tokens), set it as HATCHET_CLIENT_TOKEN on the api, and redeploy.

## Why Deploy Hogsend - Posthog Audience Stack on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Hogsend - Posthog Audience Stack on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — [Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/hogsend-posthog-audience-stack
