---
title: "Deploy Rybbit"
description: "Rybbit 2.9 privacy-friendly web analytics on ClickHouse, a GA alternative."
category: "Analytics"
url: https://railway.com/deploy/rybbit-1
---

# Deploy Rybbit

Rybbit 2.9 privacy-friendly web analytics on ClickHouse, a GA alternative.

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

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/rybbit-1/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** Analytics

## Template content

### gateway https://raw.githubusercontent.com/rybbit-io/rybbit/v2.9.0/docs/src/app/apple-icon.png

- **Image:** caddy:2.11.4-alpine
- **Start command:** `sh -c 'printf "%s\n" "$CADDYFILE" > /tmp/Caddyfile && exec caddy run --config /tmp/Caddyfile --adapter caddyfile'`
- **Health check:** /gateway_health
- **Public domain:** Yes

### clickhouse https://github.com/ClickHouse.png

- **Image:** clickhouse/clickhouse-server:26.3.17.4
- **Start command:** `sh -c 'D=/etc/clickhouse-server; printf "<clickhouse><max_server_memory_usage>%s</max_server_memory_usage><concurrent_threads_soft_limit_num>%s</concurrent_threads_soft_limit_num><logger><level>warning</level><console>true</console></logger><query_thread_log remove=\"remove\"/><query_log remove=\"remove\"/><query_views_log remove=\"remove\"/><query_metric_log remove=\"remove\"/><error_log remove=\"remove\"/><opentelemetry_span_log remove=\"remove\"/><text_log remove=\"remove\"/><trace_log remove=\"remove\"/><metric_log remove=\"remove\"/><asynchronous_metric_log remove=\"remove\"/><session_log remove=\"remove\"/><part_log remove=\"remove\"/><latency_log remove=\"remove\"/><processors_profile_log remove=\"remove\"/></clickhouse>\n" "$CLICKHOUSE_MAX_MEMORY_BYTES" "$CLICKHOUSE_MAX_THREADS" > $D/config.d/railway.xml && printf "<clickhouse><profiles><default><enable_json_type>1</enable_json_type><async_insert>1</async_insert><wait_for_async_insert>1</wait_for_async_insert><log_queries>0</log_queries><max_threads>%s</max_threads></default></profiles></clickhouse>\n" "$CLICKHOUSE_MAX_THREADS" > $D/users.d/railway.xml && exec /entrypoint.sh'`
- **Health check:** /ping

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### client https://raw.githubusercontent.com/rybbit-io/rybbit/v2.9.0/docs/src/app/apple-icon.png

- **Image:** ghcr.io/rybbit-io/rybbit-client:v2.9.0
- **Health check:** /

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### backend https://raw.githubusercontent.com/rybbit-io/rybbit/v2.9.0/docs/src/app/apple-icon.png

- **Source:** https://github.com/aalfath/rybbit-railway-template
- **Health check:** /api/health

## Documentation

# Deploy and Host Rybbit on Railway

Rybbit is an open-source, privacy-friendly web and product analytics platform and a modern alternative to Google Analytics. A tiny script records pageviews, custom events, errors and web vitals without cookies, and dashboards show traffic, funnels, goals, journeys, retention, user profiles, session replay and real-time visitors.

## About Hosting Rybbit

This template deploys Rybbit v2.9.0 as six services: the web client, the backend, ClickHouse for events, Railway Postgres, Railway Redis and a Caddy router that serves the client and API on one domain. On the very first start the backend creates the admin from environment variables, while public sign-up stays disabled. ClickHouse memory and threads are capped for Railway, and its system logs are off. The backend is built from a small wrapper repository because the large upstream image stalls when pulled at deploy time. ClickHouse is capped at 2 GB, so plan for about 3 GB across all services.

## Common Use Cases

- Cookieless website analytics for products, blogs and docs
- Product analytics with custom events, funnels and goals
- Replacing Google Analytics while keeping data in your own databases

## Dependencies for Rybbit Hosting

- `ghcr.io/rybbit-io/rybbit-client:v2.9.0`
- `aalfath/rybbit-railway-template` (backend, built from `ghcr.io/rybbit-io/rybbit-backend:v2.9.0`)
- `clickhouse/clickhouse-server:26.3.17.4` with a volume
- Railway Postgres (`ghcr.io/railwayapp-templates/postgres-ssl:18`) with a volume
- Railway Redis with a volume
- `caddy:2.11.4-alpine` router

### Deployment Dependencies

- [Rybbit documentation](https://www.rybbit.io/docs)
- [Rybbit v2.9.0 release](https://github.com/rybbit-io/rybbit/releases/tag/v2.9.0)
- [Tracking script](https://www.rybbit.io/docs/script)
- [Wrapper repository](https://github.com/aalfath/rybbit-railway-template)

### Implementation Details

| Service | Source | Networking | Storage |
| --- | --- | --- | --- |
| gateway | `caddy:2.11.4-alpine` | public domain on 8080 | none |
| client | `ghcr.io/rybbit-io/rybbit-client:v2.9.0` | private, 3002 | none |
| backend | `aalfath/rybbit-railway-template` | private, 3001 | none |
| clickhouse | `clickhouse/clickhouse-server:26.3.17.4` | private, 8123 | volume at `/var/lib/clickhouse` |
| Postgres / Redis | Railway databases | private only | volumes |

Sign in, create an organization and a site, then add the script to your pages:

```html

```

| Variable | Service | Default | Purpose |
| --- | --- | --- | --- |
| `RYBBIT_ADMIN_EMAIL` / `RYBBIT_ADMIN_PASSWORD` | backend | `admin@example.com` / generated | Admin, created on the first start |
| `DISABLE_SIGNUP` | backend | `true` | Public sign-up |
| `CLICKHOUSE_MAX_MEMORY_BYTES` / `CLICKHOUSE_MAX_THREADS` | clickhouse | 2 GiB / 4 | ClickHouse limits |

Notes:

- The client calls `/api` on its own domain, so keep the router; put custom domains on the `gateway` service.
- Invite teammates from the organization settings after signing in.

This is a community-maintained deployment package and does not imply affiliation with or endorsement by the Rybbit project or its maintainers.

## Why Deploy Rybbit on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Rybbit on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


## Similar templates

- [Typesense vs Meilisearch](https://railway.com/deploy/typesense-vs-meilisearch) — self-hosted Typesense vs Meilisearch
- [Betterlytics](https://railway.com/deploy/betterlytics) — Betterlytics is a cookieless analytics platform GDPR-compliant.
- [Finance Tracker](https://railway.com/deploy/finance-tracker-1) — Private multi-user household finance ledger with budgets and CSV import.

Open this page in a browser: https://railway.com/deploy/rybbit-1
