Railway

Deploy hitkeep-railway-template

Self-hosted HitKeep analytics with DuckDB storage.

Deploy hitkeep-railway-template

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

DependencyRailway resourcePurpose
HitKeep runtimeService from pascalebeier/hitkeep:2.7.0Runs the app, dashboard, tracker, embedded queue, and workers
Persistent dataRailway Volume at /var/lib/hitkeep/dataStores hitkeep.db, tenant databases, archives, and local backups
Public URLRailway service domainServes the dashboard and tracker script
JWT secretTemplate variable generatorCreates a unique session/signing secret for each deployment

After Deployment

  1. Open the generated Railway domain.
  2. Create the initial admin user.
  3. Add your first site.
  4. Install the tracker by loading https://your-hitkeep-domain/hk.js from 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


Template Content

More templates in this category

View Template
Matomo Analytics + MariaDB
Privacy-friendly analytics with MariaDB and persistent volumes.

leodev
View Template
Bugsink
Self-hosted Error Tracking. Sentry-SDK compatible

zǝʇɹoɔ oɓıɹpoɹ
View Template
SubTrackr
Self-hosted Subscription Tracker

amnesia