Deploy Cloudreve — Self-Hosted Cloud Storage & File Sharing
Self-host Cloudreve — Google Drive alternative with WebDAV
Redis
Just deployed
/data
Just deployed
/var/lib/postgresql/data
cloudreve
Just deployed
/cloudreve/data
Bucket
Bucket
Just deployed
Deploy and Host Cloudreve on Railway
Cloudreve is a powerful open-source cloud storage and file-sharing platform — a self-hosted alternative to Google Drive, Dropbox, and Nextcloud, built in Go with a fast React interface. Its standout strength is multi-backend storage: keep files on a local volume or distribute them across S3, Cloudflare R2, Backblaze B2, OneDrive, and more, with WebDAV access, in-browser file preview, multi-user management, and shareable links. This template deploys Cloudreve v4 with PostgreSQL and Redis pre-wired, so you have a private, scalable cloud drive in minutes.
What This Template Deploys
| Service | Purpose |
|---|---|
| Cloudreve | The file management platform, web UI, and WebDAV server (Go + React) |
| PostgreSQL | Metadata, user accounts, file records, and share configs |
| Redis (Valkey) | Caching and session management |
All three connect over Railway's private network. A persistent volume at /cloudreve/data holds local file uploads and configuration, with Postgres for durable metadata and Redis for fast caching — so it scales well beyond a single-container SQLite setup.
About Hosting
Cloudreve v4 is a serious file platform, and a few specifics make it deploy cleanly and scale — all handled here.
Three services, pre-wired — the setup that's fiddly by hand. Cloudreve v4 wants PostgreSQL for metadata and Redis for caching and sessions, not the default SQLite, for real performance. This template wires all three over the private network, so you skip the start-order races and connection config that trip up manual deployments and get a production-grade stack from the first deploy.
Environment config locks in on first boot. This is the key thing to know: the database and Redis settings you pass as environment variables build Cloudreve's conf.ini on first start, and can't be changed later by editing variables. To change core configuration afterward, you redeploy while keeping the same /cloudreve/data volume mounted, so your data carries over. Get the connections right at first deploy — this template does.
Offload large storage to S3 — the smart scaling move. Cloudreve's best feature for Railway is that it doesn't have to store files on the Railway volume. Point it at an S3-compatible bucket — Cloudflare R2, Backblaze B2, MinIO, AWS S3 — and your files live in cheap object storage while Cloudreve manages them, keeping the Railway volume light. For a large drive, this is far more economical than fat block storage; local volume storage suits smaller or temporary use.
Create your admin on first visit. Cloudreve v4 dropped default admin credentials in favor of a signup flow: the first account you register through the web UI becomes the administrator. Open your Railway URL, create that account, then configure storage policies and add users.
WebDAV, previews, and sharing. Mount Cloudreve as a network drive over WebDAV from Finder, Windows Explorer, or mobile sync apps; preview and edit documents, images, video, audio, and ePub in the browser; and generate shareable links with permissions. A full Drive replacement, not just storage.
Typical cost: ~$10–15/month on Railway for the three services, plus object storage if you use S3. Cloudreve Community is GPL-3.0 and free.
How It Compares
| Cloudreve (self-hosted) | Google Drive | Dropbox | Nextcloud | |
|---|---|---|---|---|
| Storage backends | 10+ (local, S3, R2…) | Dropbox | Local + external | |
| WebDAV | Yes | No | Limited | Yes |
| Footprint | Light (Go) | N/A | N/A | Heavier (PHP) |
| Multi-user | Yes | Per account | Per seat | Yes |
| Data ownership | Full — your infra | Vendor | Full | |
| Self-hostable | Yes | No | No | Yes |
Google Drive and Dropbox are convenient but bill by storage and hold your files. Nextcloud is a capable self-hosted suite but heavier and PHP-based. Cloudreve's edge is a lightweight, storage-flexible file platform — distribute files across local and many cloud backends, with WebDAV and browser preview — self-hosted at flat infrastructure cost, with your files and user data on infrastructure you own.
Deploy in Under 5 Minutes
- Click Deploy on Railway — Cloudreve, PostgreSQL, and Redis build and wire together (~4 minutes)
- Confirm the database and Redis connections and the
/cloudreve/datavolume are set - Open your Railway URL and register the first account — it becomes the administrator
- In admin settings, configure a storage policy (local, or an S3-compatible bucket)
- Upload files, generate share links, or connect a WebDAV client to mount your drive
For a large drive, point a storage policy at S3, R2, or B2 to keep costs down.
Common Use Cases
- Private cloud drive — a self-hosted Google Drive for your files, on infrastructure you own
- File sharing — generate shareable links with permissions instead of using a public service
- Multi-backend storage — distribute files across S3, R2, B2, and OneDrive from one interface
- Team file hub — multi-user file management with accounts and per-user storage
Configuration
| Variable | Required | Description |
|---|---|---|
CR_CONF_Database.* | Auto-injected | PostgreSQL connection for metadata (locks in on first boot) |
CR_CONF_Redis.* | Auto-injected | Redis/Valkey connection for caching and sessions |
| Storage volume | Pre-set | Persistent volume at /cloudreve/data for uploads and config |
PORT | Pre-set | 5212 — the web UI and API |
Config locks in on first boot. Database and Redis settings build
conf.iniat first start and can't be changed by editing variables later — redeploy with the same/cloudreve/datavolume to carry data over. Get connections right at deploy; this template does.
Offload to S3 for large storage. Rather than filling the Railway volume, point a storage policy at S3, R2, or B2 so files live in cheap object storage while Cloudreve manages them. The first registered account is the admin.
Dependencies for Cloudreve Hosting
- Railway account — ~$10–15/month for the three services, plus object storage if using S3
- PostgreSQL and Redis/Valkey (both included and wired)
- A persistent volume at
/cloudreve/datafor local uploads and config (included) - Optional: an S3-compatible bucket (R2, B2, MinIO, S3) for scalable file storage
Deployment Dependencies
- Cloudreve GitHub Repository
- Cloudreve Documentation
- Cloudreve Docker Guide
- Railway Private Networking
Implementation Details
The template runs the official Cloudreve v4 image (Go backend, React frontend) on port 5212, wired to a PostgreSQL 17 service for metadata and a Redis/Valkey service for caching and session management over Railway's private network, with a persistent volume at /cloudreve/data for local file uploads and configuration. This three-service setup delivers better performance and scalability than Cloudreve's default single-container SQLite mode.
Cloudreve builds its conf.ini from the database and Redis environment variables on first boot, after which those values are fixed; changing core configuration later requires redeploying while mounting the same /cloudreve/data volume so data persists. Cloudreve v4 removed default admin credentials in favor of a signup flow, so the first account registered through the web UI becomes the administrator.
A major strength is multi-backend storage: beyond the local volume, Cloudreve supports S3-compatible buckets (AWS S3, Cloudflare R2, Backblaze B2, MinIO), OneDrive, and other providers, so large libraries can live in economical object storage rather than on the Railway volume. It also provides WebDAV access for mounting as a network drive, in-browser preview and editing of documents and media, shareable links with permissions, and Aria2/qBittorrent remote downloads. Metadata in PostgreSQL and files (local or in object storage) are the components to back up.
Frequently Asked Questions
Why does Cloudreve need PostgreSQL and Redis? Cloudreve v4 uses PostgreSQL for metadata, user accounts, and file records, and Redis for caching and sessions — far more scalable than the default SQLite. This template wires both so you get a production-grade setup immediately.
How do I create my admin account? Cloudreve v4 uses a signup flow — the first account you register through the web UI becomes the administrator. There are no default credentials. Open your Railway URL and register.
Can I store files in S3 instead of the volume? Yes, and it's recommended for large drives — point a storage policy at S3, R2, B2, or MinIO, and files live in cheap object storage while Cloudreve manages them, keeping the Railway volume light.
Does it support WebDAV? Yes — mount Cloudreve as a network drive in Finder, Windows Explorer, or mobile sync apps over WebDAV, syncing files directly with your storage.
Does my data persist? Yes — metadata in PostgreSQL, and files on the /cloudreve/data volume or your configured object storage. Back up PostgreSQL and your file storage to preserve everything.
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 get a private cloud drive with the hard parts solved — PostgreSQL and Redis wired, a persistent volume for uploads, S3 offload available for scale, and automatic HTTPS. A flexible, self-hosted Google Drive alternative, on infrastructure you own.
Template Content