---
title: "Deploy Wakapi coding statistics"
description: "Private coding statistics with durable PostgreSQL storage."
category: "Analytics"
url: https://railway.com/deploy/wakapi-coding-statistics
---

# Deploy Wakapi coding statistics

Private coding statistics with durable PostgreSQL storage.

**[Deploy Wakapi coding statistics on Railway](https://railway.com/template/wakapi-coding-statistics)**

- **Creator:** Anton Orel's Projects
- **Category:** Analytics

## Template content

### Wakapi App

- **Image:** ghcr.io/muety/wakapi:2.17.5@sha256:b2ed3753af47c5adef330243c2431b04940f2560b57b9dba6029fd851a8f64a9

### Wakapi

- **Image:** caddy:2.11.4-alpine@sha256:5f5c8640aae01df9654968d946d8f1a56c497f1dd5c5cda4cf95ab7c14d58648
- **Start command:** `/bin/sh -ec 'until curl -fsS -H "Content-Type: application/json" "$WAKAPI_UPSTREAM/api/health" | grep -q '"'"'"db":1'"'"'; do sleep 2; done; signup_status="$(curl -sS -o /dev/null -w '"'"'%{http_code}'"'"' --data-urlencode "username=$ADMIN_USERNAME" --data-urlencode "password=$ADMIN_PASSWORD" --data-urlencode "password_repeat=$ADMIN_PASSWORD" --data-urlencode "email=$ADMIN_EMAIL" "$WAKAPI_UPSTREAM/signup")"; case "$signup_status" in 302) login_status="$(curl -sS -o /dev/null -w '"'"'%{http_code}'"'"' --data-urlencode "username=$ADMIN_USERNAME" --data-urlencode "password=$ADMIN_PASSWORD" "$WAKAPI_UPSTREAM/login")"; [ "$login_status" = 302 ] ;; 409) ;; *) echo "Administrator bootstrap failed with HTTP $signup_status" >&2; exit 1 ;; esac; (while true; do if curl -fsS -H "Content-Type: application/json" "$WAKAPI_UPSTREAM/api/health" | grep -q '"'"'"db":1'"'"'; then printf "OK\n" >/tmp/wakapi-health; else rm -f /tmp/wakapi-health; fi; sleep 5; done) & printf "%s\n" "$GATEWAY_CONFIG" >/tmp/Caddyfile; exec caddy run --config /tmp/Caddyfile --adapter caddyfile'`
- **Health check:** /healthz
- **Public domain:** Yes

### Postgres

- **Image:** postgres:16-alpine@sha256:57c72fd2a128e416c7fcc499958864df5301e940bca0a56f58fddf30ffc07777

## Documentation

# Deploy and Host Wakapi on Railway

## About Hosting Wakapi

Wakapi is a self-hosted WakaTime-compatible backend for collecting coding activity. This template runs Wakapi 2.17.5 with durable PostgreSQL storage, automated schema migrations, a generated administrator, closed public registration, and dependency-aware health reporting.

## Why Deploy Wakapi on Railway

One click creates a private application and database behind one public gateway. Editors can send heartbeats through the familiar WakaTime protocol while teams retain their own coding-activity data.

## Common Use Cases

- Track editor activity without sending it to a hosted analytics provider.
- Compare time by project, language, editor, and operating system.
- Give a small team a shared, self-hosted coding dashboard.

## Dependencies for Wakapi Hosting

The deployment uses immutable upstream images and Railway private networking.

### Deployment Dependencies

- [Wakapi](https://wakapi.dev) receives heartbeats and renders coding statistics.
- [PostgreSQL](https://www.postgresql.org) persists users, API keys, heartbeats, and summaries.
- [Caddy](https://caddyserver.com) creates the administrator and blocks public registration.
- [Railway](https://railway.com) provides generated secrets, private networking, HTTPS, health checks, and persistent storage.


## 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/wakapi-coding-statistics
