
Deploy Rustrak | (Just Updated) Self-Hosted Sentry Alternative, Error Tracking API Token Ready From Boot
Rustrak self-hosted Sentry-compatible error tracking, REST API, SQLite
Just deployed
/data
Deploy and Host Rustrak on Railway
Built for an LLM agent to deploy and use. The deploy form has no fields to fill: the admin password, the API token and the session secret are generated, the dashboard login exists from the first request, and the REST API takes the generated token as a Bearer header. Rustrak is a self-hosted, Sentry-compatible error tracker: point any Sentry SDK at its DSN and read the grouped issues in the dashboard or over the API.
About Hosting Rustrak
This template runs one service, rustrak (a single Rust process serving the API, the ingest endpoint and the dashboard, with a built-in SQLite database), with the database on one volume mounted at /data. There is no separate database or queue service to run.
Ready from boot. A stock Rustrak needs a human to sign in to the dashboard and mint an API token before any API call works, builds the DSN from the bind address (0.0.0.0:8080) and sends anonymous telemetry. This template's image creates the admin account (admin@example.com, add an ADMIN_EMAIL variable to change it) from ADMIN_PASSWORD, installs API_TOKEN as a real API token, derives PUBLIC_URL from the Railway domain so DSNs point at your public URL, turns telemetry off, and refuses to start if a secret is empty.
What persists. Projects, issues, events, accounts and tokens live on the volume at /data.
Using the web interface. Open the public URL and sign in as admin@example.com with the ADMIN_PASSWORD value from the service variables.
Agent contract
- Public URL:
https://RAILWAY_PUBLIC_DOMAIN(the generated domain of therustrakservice) - Private URL:
http://rustrak.railway.internal:8080 - Credentials: the variable
API_TOKENon therustrakservice for the API;ADMIN_PASSWORD(loginadmin@example.com; add anADMIN_EMAILvariable to change it) for the dashboard - Auth: send the header
Authorization: Bearer API_TOKEN_VALUE(the value of theAPI_TOKENvariable) on every/apimanagement request; without a valid token the API answers401. SDKs send events with the project DSN, whose public key authenticatesPOST /api/PROJECT_ID/envelope/ - Health:
GET /healthreturns 200 without credentials
# needs: SITE_URL (public https URL of the rustrak service) and API_TOKEN (its variable); also curl, sed
AUTH="Authorization: Bearer $API_TOKEN"
ENVELOPE='{"event_id":"f07e1ad1d53f7402d991ac11f25cf0ce"}
{"type":"event"}
{"event_id":"f07e1ad1d53f7402d991ac11f25cf0ce","level":"error","platform":"python","message":"agent-check boom","exception":{"values":[{"type":"ValueError","value":"agent-check boom"}]}}'
curl -s -o /dev/null -w "health: %{http_code}\n" "$SITE_URL/health"
curl -s -o /dev/null -w "read without token: %{http_code}\n" "$SITE_URL/api/projects"
curl -s -o /dev/null -w "write without key: %{http_code}\n" -X POST -H "Content-Type: application/json" -d '{"name":"agent-check"}' "$SITE_URL/api/projects"
curl -s -o /dev/null -w "write wrong key: %{http_code}\n" -X POST -H "Authorization: Bearer 0000000000000000000000000000000000000000" -H "Content-Type: application/json" -d '{"name":"agent-check"}' "$SITE_URL/api/projects"
P=$(curl -s -X POST -H "$AUTH" -H "Content-Type: application/json" -d '{"name":"agent-check"}' "$SITE_URL/api/projects")
ID=$(echo "$P" | sed -n 's/^{"id":\([0-9]*\),.*/\1/p')
KEY=$(echo "$P" | sed -n 's/.*"sentry_key":"\([^"]*\)".*/\1/p')
echo "project created: $ID"
echo "dsn: $(echo "$P" | sed -n 's/.*"dsn":"\([^"]*\)".*/\1/p')"
curl -s -o /dev/null -w "event ingest: %{http_code}\n" -X POST -H "X-Sentry-Auth: Sentry sentry_key=$KEY, sentry_version=7" --data-binary "$ENVELOPE" "$SITE_URL/api/$ID/envelope/"
sleep 3
{ curl -s -H "$AUTH" "$SITE_URL/api/projects/$ID/issues"; echo; } | sed -n 's/.*"title":"\([^"]*\)".*/issue: \1/p'
curl -s -o /dev/null -w "project delete: %{http_code}\n" -X DELETE -H "$AUTH" "$SITE_URL/api/projects/$ID"
A fresh deploy prints health: 200, read without token: 401, write without key: 401, write wrong key: 401, a created project id, a dsn: line on your public domain, event ingest: 200, issue: ValueError: agent-check boom and project delete: 204.
Why Deploy Rustrak 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 Rustrak 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.
- Agent-ready - no deployer fields, a contract block and one script that proves the token, a write, the ingest path and the refusal without a token.
- Usable DSNs - the DSN carries your public domain instead of
0.0.0.0:8080. - Data survives redeploys - the database sits on a volume.
- Pinned - the image is pinned by digest, telemetry is off.
- Your errors stay yours - no cloud account, no per-event pricing.
Common Use Cases
- Self-hosted Sentry alternative - one small Rust process instead of the multi-service Sentry stack, using the standard Sentry SDKs.
- Error tracking for side projects and small teams - grouped issues, events and release info without a per-event bill.
- Agent-run observability - a coding agent creates a project, gets its DSN, wires the SDK and reads the issues back over the REST API.
- Staging and CI error sink - an inexpensive place for test environments to report crashes.
Dependencies for Rustrak Hosting
- Nothing else: SQLite runs inside the service on its volume. A custom domain is optional.
Deployment Dependencies
Template Content
