---
title: "Deploy swetrix"
description: "Open source, privacy-first web analytics"
category: "Analytics"
url: https://railway.com/deploy/swetrix
---

# Deploy swetrix

Open source, privacy-first web analytics

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

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

## Template content

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

- **Image:** redis:8.2.1
- **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"`

### frontend https://raw.githubusercontent.com/Swetrix/swetrix/8776aec04de1f8c3deb1ed047c2e3b44698c181a/web/public/assets/logo/light.svg

- **Source:** osbytes/template-swetrix

### clickhouse https://avatars.githubusercontent.com/u/54801242?s=48&v=4

- **Source:** osbytes/template-swetrix
- **Health check:** /ping

### gateway https://raw.githubusercontent.com/Swetrix/swetrix/8776aec04de1f8c3deb1ed047c2e3b44698c181a/web/public/assets/logo/light.svg

- **Source:** osbytes/template-swetrix
- **Health check:** /
- **Public domain:** Yes

### api https://raw.githubusercontent.com/Swetrix/swetrix/8776aec04de1f8c3deb1ed047c2e3b44698c181a/web/public/assets/logo/light.svg

- **Source:** osbytes/template-swetrix

## Documentation

# Deploy and Host swetrix on Railway

Swetrix is an open-source, privacy-first web analytics platform — a cookieless Google Analytics alternative with built-in error tracking, performance monitoring, funnels, and custom events. Community Edition is self-hostable so you keep full ownership of your traffic data.

## About Hosting swetrix

This template deploys Swetrix Community Edition as five services: a public nginx gateway, the web UI, the analytics API, Redis for caching, and ClickHouse for analytics storage. Only the gateway is exposed; UI and API share one origin via `/backend/` routing (Swetrix v5). You get a working dashboard after deploy — register the first admin account, then further sign-ups stay blocked when registration is disabled. Optional SMTP unlocks password resets and invites; Google/OIDC integrations can be added later via env vars.

## Common Use Cases

- Self-host privacy-friendly analytics for marketing sites and product apps without cookies or consent banners
- Replace Google Analytics with cookieless traffic, funnels, custom events, and real-user performance metrics you control
- Run GDPR-oriented analytics on your own infrastructure with exportable data and no third-party tracking vendor

## Dependencies for swetrix Hosting

- Redis — session/caching layer for the API
- ClickHouse — analytics and transactional store for events and dashboard queries

### Deployment Dependencies

- [Swetrix](https://github.com/Swetrix/swetrix) — main application
- [Swetrix selfhosting](https://github.com/swetrix/selfhosting) — official Docker Compose reference
- [osbytes/template-swetrix](https://github.com/osbytes/template-swetrix) — Railway template source
- [Self-hosting docs](https://docs.swetrix.com/selfhosting/how-to) — setup and configuration guide

## Why Deploy swetrix 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 swetrix 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

- [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/swetrix
