---
title: "Deploy piqo-selfhost"
description: "Web analytics, self-hosted and truly yours."
category: "Analytics"
url: https://railway.com/deploy/piqo-selfhost
---

# Deploy piqo-selfhost

Web analytics, self-hosted and truly yours.

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

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

- **Creator:** Mohd Danish's Projects
- **Category:** Analytics

## Template content

### mddanishyusuf/piqo-selfhost:1

- **Image:** ghcr.io/mddanishyusuf/piqo-selfhost:latest
- **Health check:** /api/health
- **Public domain:** Yes

## Documentation

# Deploy and Host Piqo Analytics on Railway

Piqo Analytics is privacy-first web analytics you run on your own server. It ships as one container with SQLite inside, so there is no external database to manage. You get the same dashboard as piqo.app: realtime visitors, traffic sources, revenue attribution for Stripe, Paddle, Polar, Lemon Squeezy, Dodo and Creem, signups from Firebase, Supabase and Clerk, Google Search Console and Bing data, funnels, goals, AI-assistant traffic, Ask AI and an MCP server. One install tracks unlimited sites.

## About Hosting Piqo Analytics

This template deploys a single service from the `ghcr.io/mddanishyusuf/piqo-selfhost:0` image with a persistent volume mounted at `/app/data`, which holds the SQLite database, nightly backups and the optional GeoLite2 database. Railway generates `AUTH_SECRET` and sets `APP_URL` from your public domain, so there is nothing to build and no configuration to write. Deploy takes about a minute.

After deploying, open your domain, create the owner account on `/setup`, and paste your license key on `/activate` (or set `PIQO_LICENSE_KEY` before deploying to skip that screen). Add a site, drop the sub-1KB script tag on it, and visitors show up live. To update, redeploy the service: Railway pulls the latest 0.x image and migrations run on boot while your data stays on the volume. To use a custom domain, add it under Settings → Networking and set `APP_URL` to match before activating, since the license registers the hostname as your install.

A license is a one-time purchase from [piqo.app/self-hosted](https://piqo.app/self-hosted) with no renewals and updates included.

## Common Use Cases

- Replace Google Analytics with cookie-free analytics that keeps visitor data on infrastructure you control
- Tie traffic sources to signups and Stripe, Paddle, Polar or Lemon Squeezy revenue for a SaaS or indie product
- Run analytics for every site you own, or every client an agency manages, from one install
- Keep Search Console, Bing and site traffic in a single dashboard, and query it in plain English with Ask AI or from Claude via MCP

## Dependencies for Piqo Analytics Hosting

- A Piqo self-host license key from [piqo.app/self-hosted](https://piqo.app/self-hosted)
- A Railway volume at `/app/data` (attached by this template)

### Deployment Dependencies

- [Piqo self-hosted docs](https://piqo.app/docs)
- [Buy a license](https://piqo.app/self-hosted)
- [MaxMind GeoLite2](https://www.maxmind.com/en/geolite2/signup) (optional, free key for city-level geolocation via `MAXMIND_LICENSE_KEY`)
- [Anthropic API key](https://console.anthropic.com/) (optional, enables Ask AI and the MCP server via `ANTHROPIC_API_KEY`)
- Any SMTP provider (optional, `SMTP_URL` and `EMAIL_FROM` for invites, password resets and insight digests)

### Implementation Details

Required variables are generated by the template:

AUTH_SECRET=${{secret(48)}}
APP_URL=https://${{RAILWAY_PUBLIC_DOMAIN}}
PORT=3000



Optional variables you can add at deploy time or later:

PIQO_LICENSE_KEY=
MAXMIND_LICENSE_KEY=
SMTP_URL=
EMAIL_FROM=
ANTHROPIC_API_KEY=
GOOGLE_OAUTH_CLIENT_ID=
GOOGLE_OAUTH_CLIENT_SECRET=



Back up `AUTH_SECRET` together with the volume: it signs sessions and encrypts stored integration secrets.

## Why Deploy Piqo Analytics 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 Piqo Analytics 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/piqo-selfhost
