Deploy Dufs
File server with uploads, search, WebDAV and a login, files on a volume
Just deployed
/data
Deploy and Host Dufs on Railway
Dufs is a small, fast file server written in Rust. In the browser you can upload files and folders by drag and drop, download folders as zip, search, edit text files, and move or delete files. It also speaks WebDAV, so you can mount it as a network drive, and it works with plain curl.
About Hosting Dufs
This template runs dufs v0.47.0 as one service, built from a public GitHub repo that pins upstream's official binary by version and digest. Files live on a Railway volume at /data, so they survive redeploys and restarts. A login is on from the first deploy: the username is admin and the password is generated. Copy both from the service's Variables tab. The service won't start without a password, so your files are never served without a login. Dufs uses only a few MB of RAM, so Railway's Free plan is enough. Updates arrive as Railway update notices, and you choose when to apply them.
Common Use Cases
- A private place to drop and fetch files from any device, through the browser or
curl - A WebDAV network drive for backups, rclone, Obsidian or Zotero sync, or office apps
- Sharing large files, builds or datasets with a link, or hosting a static website
Dependencies for Dufs Hosting
- None beyond this one service and its volume (no database)
Deployment Dependencies
Implementation Details
After deploy: open the Railway domain and sign in with ADMIN_USERNAME and ADMIN_PASSWORD from the Variables tab. To mount it as a drive, use https://YOUR-DOMAIN as the WebDAV address with the same login (macOS: Finder, Go, Connect to Server; Windows: Map network drive; Linux: davs://YOUR-DOMAIN).
curl -u admin:PASSWORD -T report.pdf https://YOUR-DOMAIN/docs/report.pdf # upload
curl -u admin:PASSWORD "https://YOUR-DOMAIN/docs?zip" -o docs.zip # folder as zip
Services: one service, Dufs. Volume at /data, port 5000, health check /__dufs__/health (no login needed), restart policy ON_FAILURE. If dufs ever crashes, the wrapper exits non-zero so that Railway restarts it.
Options: add PUBLIC_READ=true so that anyone can browse and download while only the admin can change files. Any DUFS_* option from the dufs docs also works, such as DUFS_ENABLE_CORS=true or DUFS_RENDER_TRY_INDEX=true for static sites. DUFS_AUTH takes dufs's own rules for several accounts or per-folder access, and replaces the admin login variables.
Updates: when dufs releases a new version, we bump the pin in the repo and note it in CHANGELOG.md. Railway then offers you the update, and your files stay on the volume.
Why Deploy Dufs 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 Dufs 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
