---
title: "Deploy Borgitory | (Just Updated) BorgBackup Web UI & API, Scheduled Backups, Admin Pre-Created"
description: "Borgitory BorgBackup web UI and REST API, scheduled backups, rclone"
category: "Other"
url: https://railway.com/deploy/borgitory-or-just-updated-borgbackup-web
---

# Deploy Borgitory | (Just Updated) BorgBackup Web UI & API, Scheduled Backups, Admin Pre-Created

Borgitory BorgBackup web UI and REST API, scheduled backups, rclone

**[Deploy Borgitory | (Just Updated) BorgBackup Web UI & API, Scheduled Backups, Admin Pre-Created on Railway](https://railway.com/template/borgitory-or-just-updated-borgbackup-web)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/borgitory-or-just-updated-borgbackup-web/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** Other

## Template content

### borgitory

- **Image:** ghcr.io/bon5co/borgitory-railway:3.0.0@sha256:3d89f5fdb5a3ed9c9ee64590f9a171acd2cd54ffc01bcb19acd6bf284c472375
- **Health check:** /login
- **Public domain:** Yes

## Documentation

# Deploy and Host Borgitory on Railway

**Built for an LLM agent to deploy and use.** The deploy form has no fields to fill: the only administrator is created from generated credentials at first boot, public registration is closed before the first request is served, and the repository API takes a session cookie from a normal sign-in. Borgitory is an open-source web interface and REST API for BorgBackup: create and manage Borg repositories, schedule backups, prune archives, check repository integrity and sync to cloud storage with rclone.

## About Hosting Borgitory

This template runs one service, **borgitory** (the web interface and the JSON API behind one public domain), with a volume mounted at `/app/data`. The volume holds the SQLite database, the generated secret key and the default location for repositories, `/app/data/repos`. The image bundles BorgBackup 1.4 and rclone.

**Locked from boot.** A stock Borgitory lets the first visitor to the URL register and become the only user, serves host, environment and database details from `/api/debug/*` to anyone, and listens on a hard-coded port that Railway's proxy and healthcheck never reach. This template's image listens on Railway's `PORT`, creates the administrator from `ADMIN_USERNAME` and `ADMIN_PASSWORD` before the server starts (registration then answers 403), and requires a session on the debug routes.

**What persists.** Users, repository definitions, schedules, job history and the signing key live on the volume, so sessions and credentials survive redeploys. Repositories created under `/app/data/repos` live on the same volume; for real backups point repositories at a remote SSH host or sync them off-site with rclone.

**Limits on Railway.** Browsing archives as a mounted filesystem needs FUSE (`SYS_ADMIN`), which Railway does not grant, so that feature is unavailable. Listing, extracting, pruning, checking and cloud sync work.

**Using the web interface.** Open the public URL and sign in with the `ADMIN_USERNAME` and `ADMIN_PASSWORD` values from the borgitory service variables.

### Agent contract

- Public URL: `https://RAILWAY_PUBLIC_DOMAIN` (the generated domain of the `borgitory` service)
- Private URL: `http://borgitory.railway.internal:8080`
- Credentials: the variables `ADMIN_USERNAME` and `ADMIN_PASSWORD` on the `borgitory` service
- Auth: sign in with `POST /auth/login` (form fields `username`, `password`, `remember_me=true`); the response sets an `auth_token` cookie to send on every `/api` request, and without it the API answers `401`
- Health: `GET /login` returns 200 without credentials

```bash
#!/bin/sh
# needs: SITE_URL (public https URL of the borgitory service), ADMIN_USERNAME and ADMIN_PASSWORD (its variables); also curl, sed
J=$(mktemp)
curl -s -o /dev/null -w "health: %{http_code}\n" "$SITE_URL/login"
curl -s -o /dev/null -w "read without key: %{http_code}\n" "$SITE_URL/api/repositories/"
curl -s -o /dev/null -w "write without key: %{http_code}\n" -X POST -H "Content-Type: application/json" -d '{"name":"x","path":"/app/data/repos/x","passphrase":"passphrase-x","encryption_type":"repokey"}' "$SITE_URL/api/repositories/"
curl -s -o /dev/null -w "debug without key: %{http_code}\n" "$SITE_URL/api/debug/info"
curl -s -o /dev/null -w "wrong password: %{http_code}\n" -X POST -d "username=$ADMIN_USERNAME" -d "password=not-the-password" "$SITE_URL/auth/login"
curl -s -o /dev/null -w "public sign-up: %{http_code}\n" -X POST -d "username=intruder" -d "password=intruder-pass-123" -d "confirm_password=intruder-pass-123" "$SITE_URL/auth/register"
curl -s -o /dev/null -w "login: %{http_code}\n" -c "$J" -X POST -d "username=$ADMIN_USERNAME" --data-urlencode "password=$ADMIN_PASSWORD" -d "remember_me=true" "$SITE_URL/auth/login"
curl -s -o /dev/null -w "repository create: %{http_code}\n" -b "$J" -X POST -H "Content-Type: application/json" -d '{"name":"agent-check","path":"/app/data/repos/agent-check","passphrase":"agent-check-pass","encryption_type":"repokey"}' "$SITE_URL/api/repositories/"
{ curl -s -b "$J" "$SITE_URL/api/repositories/"; echo; } | sed -n 's/.*"name":"\(agent-check\)".*/repository read: \1/p'
RID=$(curl -s -b "$J" "$SITE_URL/api/repositories/" | sed -n 's/.*"id":\([0-9]*\),"name":"agent-check".*/\1/p')
echo "repository id: $RID"
curl -s -o /dev/null -w "repository delete: %{http_code}\n" -b "$J" -X DELETE "$SITE_URL/api/repositories/$RID"
rm -f "$J"
```

A fresh deploy prints `health: 200`, `read without key: 401`, `write without key: 401`, `debug without key: 401`, `wrong password: 401`, `public sign-up: 403`, `login: 200`, `repository create: 200`, `repository read: agent-check`, a repository id and `repository delete: 200`.

## Why Deploy Borgitory 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 Borgitory 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 a sign-in, a write, a read, a delete and the refusal without a session.
- **Locked by default** - the deploy cannot start as an open instance where the first visitor becomes the administrator, and the debug routes are not public.
- **Data survives redeploys** - database, signing key and local repositories sit on a volume.
- **Pinned** - the upstream image is pinned by digest.
- **No SaaS backup dashboard** - schedules and history stay on your own infrastructure.

## Common Use Cases

- **BorgBackup web UI** - manage Borg repositories, archives and schedules from a browser instead of cron and shell scripts.
- **Agent-driven backup management** - an ops agent creates repositories and reads their status over the JSON API.
- **Off-site backup sync** - run Borg backups and push repositories to S3, Backblaze or other rclone targets.
- **Backup monitoring for a homelab or small team** - one dashboard for job history and repository health.

## Dependencies for Borgitory Hosting

- None beyond the borgitory service and its volume. A remote SSH host or an rclone-compatible cloud bucket is optional, for storing backups off Railway. A custom domain is optional.

### Deployment Dependencies

- [Borgitory repository](https://github.com/mlapaglia/borgitory)
- [Borgitory documentation](https://mlapaglia.github.io/Borgitory/)
- [Official Docker image](https://hub.docker.com/r/mlapaglia/borgitory)
- [Wrapper image source](https://github.com/bon5co/borgitory-railway)


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/borgitory-or-just-updated-borgbackup-web
