---
title: "Deploy hitkeep-railway-template"
description: "Self-hosted HitKeep analytics with DuckDB storage."
category: "Analytics"
url: https://railway.com/deploy/hitkeep-railway-template
---

# Deploy hitkeep-railway-template

Self-hosted HitKeep analytics with DuckDB storage.

**[Deploy hitkeep-railway-template on Railway](https://railway.com/template/hitkeep-railway-template)**

- **Creator:** liyu's Projects
- **Category:** Analytics

## Template content

### hitkeep

- **Image:** pascalebeier/hitkeep:2.7.0
- **Public domain:** Yes

## Documentation

# Deploy and Host HitKeep

Deploy [HitKeep](https://hitkeep.com), 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

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

- HitKeep: https://hitkeep.com
- Source: https://github.com/PascaleBeier/hitkeep
- Template source: https://github.com/yunyu950908/hitkeep-railway-template


## Similar templates

- [Matomo Analytics + MariaDB](https://railway.com/deploy/matomo-analytics-mariadb) — Privacy-friendly analytics with MariaDB and persistent volumes.
- [Bugsink](https://railway.com/deploy/bugsink) — Self-hosted Error Tracking. Sentry-SDK compatible
- [SubTrackr](https://railway.com/deploy/bscottsubtrackr) — Self-hosted Subscription Tracker

Open this page in a browser: https://railway.com/deploy/hitkeep-railway-template
