Deploy Tianji

Website analytics, uptime monitoring and server status in one app

Deploy Tianji

/var/lib/postgresql/data

Deploy and Host Tianji on Railway

Tianji is an open-source, self-hosted monitoring app that combines privacy-friendly website analytics, uptime monitoring and server status in one place. It also offers status pages, surveys, telemetry and webhook alerts, so a small team can watch its sites and servers without running several separate tools.

About Hosting Tianji

This template deploys Tianji 1.34.3 from the official image, pinned by version and digest, together with Railway's PostgreSQL on a persistent volume. Every Tianji record (users, websites, events, monitors, status pages) is stored in Postgres, so data survives redeploys and restarts. On each start, a small wrapper runs the database migrations and then starts the server on a public HTTPS domain with a health check on /health. Tianji's seeded admin/admin login is replaced with a generated password on first start, and open registration stays off. Updates arrive as Railway update notices when the pinned version is bumped in the template's GitHub repo.

Common Use Cases

  • Cookie-free website analytics as a lighter alternative to Google Analytics
  • Uptime monitoring of websites, APIs and services, with alerts and public status pages
  • Tracking CPU, memory and disk of your servers with the Tianji reporter

Dependencies for Tianji Hosting

  • Tianji server (official moonrailgun/tianji image, built from aalfath/tianji-railway-template)
  • PostgreSQL (Railway's managed Postgres image with a volume)

Deployment Dependencies

Implementation Details

After the deploy finishes:

  1. Open the Tianji service's Variables tab and copy ADMIN_PASSWORD.
  2. Open the public URL and sign in as admin with that password, then change it under your profile.
  3. Add a website and paste the tracking script Tianji shows into your site, or add a monitor.

There are no prompts at deploy time: the database URL, JWT_SECRET and ADMIN_PASSWORD are generated or wired for you. Optional features (SMTP email, GitHub, Google or OIDC login, a Redis cache, ClickHouse, OpenAI features, PUBLIC_URL for email links) are enabled by adding the variables from Tianji's environment docs to the Tianji service. Set ALLOW_REGISTER=true only if you want anyone with the URL to create an account.

To report a server's status, run the tianji-reporter binary from the Tianji releases on that server, pointed at YOUR-DOMAIN and the workspace ID shown in Tianji's Servers page.

Updates: the template's repo pins one Tianji release. When a newer release is tested, the pin moves on main, and Railway shows you an "update available" notice; read CHANGELOG.md in the repo, then apply it when you're ready. Back up Postgres before major upgrades.

Why Deploy Tianji 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 Tianji 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.


Template Content

More templates in this category

View Template
Plausible WordPress
Cookie-free WordPress stats from your own Plausible

onepush
0
View Template
Typesense Multilingual
Locale-aware multilingual search with Typesense

onepush
0
View Template
Formbricks
Surveys, NPS and in-app feedback on your own Postgres, Hub and Cube

Two Workspaces
3