Self-host Tianji with Levelrail
An all-in-one insight hub that combines website analytics, uptime monitoring and server status in one dashboard.
- Authormsgbyte
- LicenceApache-2.0
- Memory512 MiB
- Archarm64
- Services2
How to self-host Tianji
-
Pull the images
2 images are pulled on your server.
Show images
postgres:16-alpinemoonrailgun/tianji:1.33.9
-
Create the app
2 services start in a single Compose app, with 1 named volume mount for your data, on port 12345.
-
Fill in the secrets
3 secrets are generated and stored encrypted, 4 settings are preset, you do not have to fill in anything.
-
Open it
Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.
Tianji requirements
- Memory
- About 512 MiB
- Architectures
- amd64 image published, arm64 image published
- Ports
- 12345
- Domain
- Optional, an sslip.io address is used without one
- Settings
- none to fill in
- License
- Apache-2.0, permissive license
- Listed. It is in the catalog but not verified. Back up the data volume before changing an image tag.
Install Levelrail first
On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then Tianji. New to Levelrail? Install it on a fresh VPS first.
docker pull ghcr.io/glincker/levelrail:latest Then levelrail-cli login --device. See Getting started and the Tianji docs page.
Deploy Tianji your way
Every format below deploys the same pinned images. Pick the one that fits how you work.
Deploy Tianji from the CLI
levelrail-cli templates install tianji --name my-tianji Deploy Tianji with the API
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
https://levelrail.example.com/api/v1/service-templates/tianji/install \
-d '{
"name": "my-tianji"
}' Tianji configuration
Tianji services
| Service | Image | Ports | Volumes |
|---|---|---|---|
| db | postgres:16-alpine | none | pgdata -> /var/lib/postgresql/data |
| tianji | moonrailgun/tianji:1.33.9 | 12345 | none |
Tianji environment variables
| Variable | Service | Value |
|---|---|---|
| POSTGRES_DB | db | Preset by the template |
| POSTGRES_PASSWORD | db | Generated at deploy |
| POSTGRES_USER | db | Preset by the template |
| ALLOW_OPENAPI | tianji | Preset by the template |
| ALLOW_REGISTER | tianji | Preset by the template |
| DATABASE_URL | tianji | Generated at deploy |
| JWT_SECRET | tianji | Generated at deploy |
Ports and volumes
- Ports
- 12345
- Volumes
- 1 named mount: pgdata -> /var/lib/postgresql/data
Tianji FAQ
How much memory does Tianji need?
The catalog lists about 512 MiB of memory for Tianji across its 2 services.
Does Tianji run on arm64?
For Tianji, an arm64 image is published; amd64 is image published.
What licence is Tianji under?
Tianji is licensed under Apache-2.0, which is permissive, with few conditions on reuse.
Does Tianji need configuration before it starts?
No. The template fills in its own defaults and generates secrets at deploy time.
Which database does Tianji bundle?
The template includes Postgres, running as its own service.
Which ports does Tianji use?
Tianji listens on port 12345 inside the stack.
Where does Tianji keep its data?
In a named volume: pgdata mounted at /var/lib/postgresql/data.
Can I deploy Tianji on Dokploy or Dokku?
The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id tianji for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image postgres:16-alpine, moonrailgun/tianji:1.33.9 is what you deploy there.