Deploy Chhoto URL
Chhoto URL: self-hosted Rust URL shortener with web UI, API and hit counts
Chhoto URL
Just deployed
/data
Deploy and Host Chhoto URL on Railway
Chhoto URL is a small, very fast self-hosted URL shortener written in Rust. It gives you a password-protected web UI and a REST API for creating short links with custom or generated slugs, optional expiry, QR codes and hit counts, all stored in a single SQLite database. It is MIT-licensed.
About Hosting Chhoto URL
This template runs Chhoto URL 7.11.8 from the official image, pinned by digest and built from our public GitHub repo. The SQLite database (WAL mode) and the app's daily backups live on a Railway volume at /data, so links and hit counts survive redeploys and restarts. The admin password, the API key and the session key are generated on deploy, and the public Railway domain is set as the site URL, so nothing has to be filled in. A health check on /api/version gates each deploy. If the app stops or its internal health endpoint stops answering, the start script exits non-zero and Railway restarts it. It uses about 10 MB of RAM and fits the Free plan.
Common Use Cases
- Short, memorable links for docs, campaigns, slides and QR codes on your own domain
- A private alternative to Bitly or TinyURL with click counts and link expiry
- Creating links from scripts, CI jobs or chat bots through the REST API
Dependencies for Chhoto URL Hosting
- One Railway service built from the
aalfath/chhoto-url-railway-templateGitHub repo - One Railway volume at
/datafor the SQLite database and its backups
Deployment Dependencies
- Chhoto URL source and docs: https://github.com/SinTan1729/chhoto-url
- Configuration reference: https://github.com/SinTan1729/chhoto-url/blob/main/docs/INSTALLATION.md
- API reference: https://github.com/SinTan1729/chhoto-url/blob/main/docs/CLI.md
- Template repo, changelog and updates: https://github.com/aalfath/chhoto-url-railway-template
Implementation Details
Services: a single service, Chhoto URL, which serves the web UI, the API and the redirects. No separate database service is needed.
After deploy: open the service's public URL and log in with CHHOTO_PASSWORD from the service's Variables tab. To use the API, send CHHOTO_API_KEY in the X-API-Key header:
curl -X POST -H "X-API-Key: YOUR-API-KEY" -H "Content-Type: application/json" \
-d '{"shortlink":"docs","longlink":"https://example.com/docs"}' \
https://YOUR-DOMAIN/api/new
Leave out shortlink to get a generated adjective-noun slug. If you add a custom domain, set CHHOTO_SITE_URL to it so copy buttons and QR codes use it.
Variables: CHHOTO_PASSWORD, CHHOTO_API_KEY and CHHOTO_SESSION_MASTER_KEY are generated, CHHOTO_SITE_URL follows the public domain, and PORT is 4567. Redirects are temporary (307) by default. Other upstream options (public mode, OIDC login, slug style and length, custom title, permanent redirects) can be added as variables on the service, as described in upstream's configuration reference.
Updates: when we bump the pinned Chhoto URL version in the template repo, Railway shows you an "update available" notice. The changelog in the repo lists breaking changes first. Your links stay on the volume across updates.
Why Deploy Chhoto URL 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 Chhoto URL 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
Chhoto URL
aalfath/chhoto-url-railway-template