---
title: "Deploy hitkeep-bucket-template"
description: "Self-hosted HitKeep analytics with Railway Bucket backups."
category: "Analytics"
url: https://railway.com/deploy/hitkeep-bucket-template
---

# Deploy hitkeep-bucket-template

Self-hosted HitKeep analytics with Railway Bucket backups.

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

- **Creator:** liyu's Projects
- **Category:** Analytics
- **Total deploys:** 2

## Template content

### hitkeep

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

## Buckets

- **hitkeep-backups**

## 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`, attaches a persistent Railway volume at `/var/lib/hitkeep/data` for active DuckDB data, and provisions a Railway Bucket for backup/archive Parquet 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 and one private S3-compatible Railway Bucket. 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
- Off-volume backup/archive snapshots through Railway Buckets
- 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 active `hitkeep.db` and tenant databases |
| Backup/archive data | Railway Bucket named `hitkeep-backups` | Stores HitKeep backup and retention archive snapshots as Parquet |
| 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.
- The template writes HitKeep automatic backups and retention archives to the Railway Bucket, not the local volume.
- `HITKEEP_BACKUP_RETENTION` only prunes local filesystem backups in HitKeep 2.7.0. Railway Buckets currently do not provide bucket lifecycle configuration, so add a cleanup job if you need bounded object storage growth.
- 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-bucket-template
