Deploy hitkeep-railway-template
Self-hosted HitKeep analytics with DuckDB storage.
hitkeep
Just deployed
/var/lib/hitkeep/data
Deploy and Host HitKeep
Deploy HitKeep, an open-source privacy-first analytics platform you can self-host as one Railway service.
This template uses the official pascalebeier/hitkeep:2.7.0 Docker image, exposes port 8080, and attaches a persistent Railway volume at /var/lib/hitkeep/data for DuckDB data, tenant databases, archives, and local backup snapshots.
About Hosting HitKeep
HitKeep is a single-binary web analytics app with embedded DuckDB and embedded NSQ. It tracks pageviews, events, goals, funnels, ecommerce activity, AI crawler visibility, Search Console aggregates, exports, and read-only API/MCP access without requiring PostgreSQL, Redis, ClickHouse, Kafka, or a separate queue.
On Railway, the app runs as one persistent service backed by one attached volume. The template generates a unique HITKEEP_JWT_SECRET during deployment and configures HitKeep to use the generated Railway public domain.
Why Deploy HitKeep on Railway
- One service instead of a multi-container analytics stack
- Persistent DuckDB storage through Railway Volumes
- Public HTTPS domain generated by Railway
- Per-deployment generated JWT secret
- Fast pilot path for self-hosted analytics
- Easy migration path to a custom domain later
Common Use Cases
- Privacy-first web analytics for small teams
- Self-hosted alternative to GA4-style reporting
- Cookieless pageview and event tracking
- Conversion dashboards with goals and funnels
- Search Console aggregate reporting
- AI crawler and AI-referred traffic visibility
- Internal reporting through exports and API clients
Dependencies for HitKeep
HitKeep does not require an external database, cache, or queue. The required runtime dependency is persistent filesystem storage for its DuckDB data directory.
Deployment Dependencies
| Dependency | Railway resource | Purpose |
|---|---|---|
| HitKeep runtime | Service from pascalebeier/hitkeep:2.7.0 | Runs the app, dashboard, tracker, embedded queue, and workers |
| Persistent data | Railway Volume at /var/lib/hitkeep/data | Stores hitkeep.db, tenant databases, archives, and local backups |
| Public URL | Railway service domain | Serves the dashboard and tracker script |
| JWT secret | Template variable generator | Creates a unique session/signing secret for each deployment |
After Deployment
- Open the generated Railway domain.
- Create the initial admin user.
- Add your first site.
- Install the tracker by loading
https://your-hitkeep-domain/hk.jsfrom your site.
If you later attach a custom domain, update HITKEEP_PUBLIC_URL to the final HTTPS origin so tracker URLs, email links, and redirects stay correct.
Operational Notes
- Run one replica by default. HitKeep uses embedded DuckDB and NSQ, so a single-service deployment is the intended low-ops path.
- Keep the volume attached. Without it, analytics data will be ephemeral.
- Use Railway volume backups or external S3/R2 backups for disaster recovery. Backups stored on the same volume are convenient snapshots, not off-platform DR.
- SMTP-dependent features require Railway Pro or above because Railway disables outbound SMTP on Free, Trial, and Hobby plans.
Links
- HitKeep: https://hitkeep.com
- Source: https://github.com/PascaleBeier/hitkeep
- Template source: https://github.com/yunyu950908/hitkeep-railway-template
Template Content
hitkeep
pascalebeier/hitkeep:2.7.0PORT
HITKEEP_DB_PATH
RAILWAY_RUN_UID
HITKEEP_DATA_PATH
HITKEEP_HTTP_ADDR
HITKEEP_BACKUP_PATH
HITKEEP_ARCHIVE_PATH
HITKEEP_BACKUP_INTERVAL
HITKEEP_BACKUP_RETENTION
HITKEEP_SPAM_FILTER_PATH
HITKEEP_SPAM_FILTER_AUTO_UPDATE
