---
title: "Deploy Cloudreve | (Just Updated) Self-Hosted File Manager and Cloud Storage, Dropbox Alternative, Admin Login Generated"
description: "Cloudreve self-hosted file manager and cloud storage, admin login generated"
category: "Storage"
url: https://railway.com/deploy/cloudreve-or-just-updated-self-hosted-fi
---

# Deploy Cloudreve | (Just Updated) Self-Hosted File Manager and Cloud Storage, Dropbox Alternative, Admin Login Generated

Cloudreve self-hosted file manager and cloud storage, admin login generated

**[Deploy Cloudreve | (Just Updated) Self-Hosted File Manager and Cloud Storage, Dropbox Alternative, Admin Login Generated on Railway](https://railway.com/template/cloudreve-or-just-updated-self-hosted-fi)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/cloudreve-or-just-updated-self-hosted-fi/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** Storage

## Template content

### cloudreve

- **Image:** ghcr.io/bon5co/cloudreve-railway:4.19.1@sha256:eee5eeba5de3e91ca48c25c9c7640ede68bcaa65f8cf4d6144d300e1f54cfffe
- **Health check:** /
- **Public domain:** Yes

## Documentation

# Deploy and Host Cloudreve on Railway

**Built for an LLM agent to deploy and use.** The deploy form has no fields to fill: the administrator account is created at first boot with a generated password, public signup is closed, and the database and uploaded files live on a volume. Cloudreve is a self-hosted file manager and cloud storage with sharing links, WebDAV, remote download and many storage backends, a free alternative to Dropbox, Google Drive and Nextcloud files.

## About Hosting Cloudreve

This template runs one service, **cloudreve**: the upstream Cloudreve v4.19.1 image, pinned by digest, through a thin wrapper, with a volume at `/cloudreve/data` that holds the SQLite database, the config and the uploaded files. One public domain serves the web app and the API. The server listens on Railway's injected `PORT`, and the healthcheck is `GET /`.

**What the wrapper fixes.** Upstream Cloudreve makes the first account that registers the administrator and leaves public sign-up open, so on a public domain the first visitor to the sign-up page owns the instance. It also listens on a fixed port 5212 and ignores Railway's `PORT`, so a plain deploy never passes the edge healthcheck. The wrapper registers the administrator from the `ADMIN_PASSWORD` variable on a loopback-only instance before the public server ever binds a port, then starts Cloudreve on `PORT` with sign-up closed. It refuses to start if `ADMIN_PASSWORD` is empty or shorter than 6 characters, and it does the registration once: a marker file on the volume skips it on every later boot, so redeploys keep the same account. Read from the Cloudreve v4.19.1 source (the first registered user is elevated to the Admin group) and confirmed on the wrapper: the first account created is in the Admin group, and the same sign-up call from outside then answers code 40019 (feature not enabled). Not reproduced on a Railway control of the incumbent listing.

**Using it.** Open the domain and sign in as `admin@cloudreve.org` with `ADMIN_PASSWORD`. Everything the web app does is also the REST API under `/api/v4`: sign in at `POST /api/v4/session/token`, then send the returned access token in an `Authorization: Bearer` header. Cloudreve answers HTTP 200 for API results and reports the real status in the JSON `code` field (`0` is success, `401` login required, `40019` feature not enabled, `40080` wrong password). To use another administrator address, add an `ADMIN_EMAIL` variable before the first boot. For a custom domain add a `SITE_URL` variable. To reopen public sign-up set `CR_SETTING_register_enabled` to `1`.

### Agent contract

- Public URL: `https://RAILWAY_PUBLIC_DOMAIN` (the generated domain of the `cloudreve` service)
- Private URL: `http://cloudreve.railway.internal:8080`
- Credentials: the variable `ADMIN_PASSWORD` on the `cloudreve` service is the password of the administrator `admin@cloudreve.org` (the address is fixed unless you add an `ADMIN_EMAIL` variable)
- Auth: `POST /api/v4/session/token` with a JSON body of `email` and `password` returns `data.token.access_token`; send it as `Authorization: Bearer` on every call. Without it a write answers body code 401. Public sign-up is closed.
- Health: `GET /api/v4/site/ping` returns 200 without credentials

```bash
#!/bin/sh
# needs: RAILWAY_PUBLIC_DOMAIN, ADMIN_PASSWORD (variables of the cloudreve service); also curl, grep, sed.
# Cloudreve answers HTTP 200 for API results and reports the real status in the JSON "code" field, so each check reads that field.
R="https://$RAILWAY_PUBLIC_DOMAIN"
J="Content-Type: application/json"
STAMP=$(date +%s)
n=0; until [ "$(curl -s -o /dev/null -w '%{http_code}' "$R/api/v4/site/ping")" = 200 ]; do n=$((n+1)); [ "$n" -le 60 ] || break; sleep 5; done
curl -s -o /dev/null -w "health: %{http_code}\n" "$R/api/v4/site/ping"
# a stranger cannot write: a folder create without a token is refused with code 401
W1=$(curl -s -X POST -H "$J" -d '{"type":"folder","uri":"cloudreve://my/agent-denied"}' "$R/api/v4/file/create" | grep -c '"code":401')
if [ "$W1" = 1 ]; then echo "write without key: 401"; else echo "write without key: OPEN"; fi
W2=$(curl -s -X POST -H "$J" -H "Authorization: Bearer not-a-token" -d '{"type":"folder","uri":"cloudreve://my/agent-denied"}' "$R/api/v4/file/create" | grep -c '"code":401')
if [ "$W2" = 1 ]; then echo "write with wrong key: 401"; else echo "write with wrong key: OPEN"; fi
# a stranger cannot register: public signup is closed, refused with code 40019 (feature not enabled)
SIGNUP=$(curl -s -X POST -H "$J" -d "{\"email\":\"stranger$STAMP@example.com\",\"password\":\"pw$STAMP$STAMP\",\"language\":\"en-US\"}" "$R/api/v4/user" | grep -c '"code":40019')  # expect 403 class refusal, reported as a body code
if [ "$SIGNUP" = 1 ]; then echo "public signup: refused (code 40019)"; else echo "public signup: OPEN"; fi
# a wrong password is refused, the generated one signs in as the administrator
BAD=$(curl -s -X POST -H "$J" -d "{\"email\":\"admin@cloudreve.org\",\"password\":\"wrong$STAMP$STAMP\"}" "$R/api/v4/session/token" | grep -c '"code":40080')
if [ "$BAD" = 1 ]; then echo "login with wrong password: refused (code 40080)"; else echo "login with wrong password: ACCEPTED"; fi
TOKEN=$(curl -s -X POST -H "$J" -d "{\"email\":\"admin@cloudreve.org\",\"password\":\"$ADMIN_PASSWORD\"}" "$R/api/v4/session/token" | sed -n 's/.*"access_token":"\([^"]*\)".*/\1/p')
if [ -n "$TOKEN" ]; then echo "login with key: ok"; else echo "login with key: FAILED"; fi
# with the token a folder is created and read back
NAME="agent-$STAMP"
curl -s -X POST -H "$J" -H "Authorization: Bearer $TOKEN" -d "{\"type\":\"folder\",\"uri\":\"cloudreve://my/$NAME\"}" "$R/api/v4/file/create" -o /dev/null -w "write with key: %{http_code}\n"
FOUND=$(curl -s -H "Authorization: Bearer $TOKEN" "$R/api/v4/file?uri=cloudreve%3A%2F%2Fmy" | grep -c "\"name\":\"$NAME\"")
if [ "$FOUND" -ge 1 ]; then echo "folder listed: found"; else echo "folder listed: MISSING"; fi
```

Expected output against a fresh deploy (measured on a Railway deploy of the generated draft):

```text
health: 200
write without key: 401
write with wrong key: 401
public signup: refused (code 40019)
login with wrong password: refused (code 40080)
login with key: ok
write with key: 200
folder listed: found
```

The refusals are the contract: `write without key: 401` and `write with wrong key: 401` are body codes, and `public signup: refused (code 40019)` is Cloudreve's own refusal body for a sign-up from outside; the HTTP status of those three calls is 200 because Cloudreve reports API errors in the JSON `code` field.

## Why Deploy Cloudreve 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 Cloudreve 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 instance is healthy, a stranger can neither write nor register, and the generated password signs in and creates a folder.
- **Owned by you from the first request** - the administrator is registered before the public server starts, so nobody else can claim it.
- **Works on first deploy** - the listener already follows Railway's injected `PORT`.
- **Data survives redeploys** - the database, config and uploads live on a volume.
- **Pinned** - the upstream image is pinned by digest and the wrapper by tag and digest.

## Common Use Cases

- **Private cloud drive** - your own Dropbox or Google Drive on a domain you control.
- **File sharing with links** - share files and folders by link, with expiry and passwords.
- **WebDAV storage** - mount the drive in a file manager, a backup tool or an agent workspace.
- **Team file hub** - user groups, quotas and storage policies for a small team.

## Dependencies for Cloudreve Hosting

- The cloudreve service with its volume, created by the template. A custom domain is optional; add it as a `SITE_URL` variable if you use one.

### Deployment Dependencies

- [Cloudreve repository](https://github.com/cloudreve/cloudreve)
- [Cloudreve documentation](https://docs.cloudreve.org/)
- [Wrapper image source](https://github.com/bon5co/cloudreve-railway)


## Similar templates

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — A PostgreSQL-based time-series database for analytics on Railway.
- [Neo4j 2026.10 Community](https://railway.com/deploy/neo4j-202610-community) — Neo4j graph database with APOC, Browser, Bolt TCP proxy and a volume

Open this page in a browser: https://railway.com/deploy/cloudreve-or-just-updated-self-hosted-fi
