
Deploy ZFile
Deploy and Host ZFile with Railway
zhaojun1998/zfile:latest
Just deployed
/root/.zfile-v4/
Deploy and Host ZFile on Railway
ZFile is an open-source cloud storage and file indexing platform built with Java and Spring Boot. It provides a modern web interface for managing and sharing files across local storage, Amazon S3, OneDrive, Google Drive, FTP/SFTP, WebDAV, and other storage providers through a single self-hosted application.
About Hosting ZFile
Hosting ZFile on Railway provides a simple way to deploy a production-ready file management platform without managing servers. Railway runs the official Docker image, automatically provisions HTTPS, public networking, and deployment management while allowing you to attach persistent volumes for long-term data storage.
ZFile stores its configuration, embedded SQLite database, application logs, and local storage files on disk, making Railway Volumes essential for production deployments. External storage providers such as Amazon S3, Google Drive, OneDrive, FTP, SFTP, and WebDAV are configured from the ZFile administration panel after deployment. Railway also supports custom domains, automatic redeployments, and scalable infrastructure, making it easy to host your own cloud storage gateway.
Common Use Cases
- Self-hosted cloud file management and sharing
- Unified access to multiple cloud storage providers
- Personal or team document and media hosting
Dependencies for ZFile Hosting
| Dependency | Required | Purpose |
|---|---|---|
| Docker Image | Yes | Runs the ZFile application |
| Railway Volumes | Yes | Stores the database, logs, and local files |
Deployment Dependencies
| Resource | Link |
|---|---|
| Official Website | https://www.zfile.vip/ |
| GitHub Repository | https://github.com/zfile-dev/zfile |
| Docker Deployment Guide | https://docs.zfile.vip/install/os-docker |
| Docker Hub Image | https://hub.docker.com/r/zhaojun1998/zfile |
| Live Demo | https://demo.zfile.vip/ |
Implementation Details
Docker
Deploy the official Docker image:
zhaojun1998/zfile:latest
Railway deploys the image directly, so no custom build or start commands are required.
Public Networking
| Setting | Value |
|---|---|
| Proxy Type | HTTP Proxy |
| Target Port | 8080 |
After deployment, generate a public domain from Settings → Networking → Generate Domain.
Environment Variables
ZFile works with its default configuration and does not require any mandatory environment variables.
| Variable | Required | Description |
|---|---|---|
PORT | No | Internal application listening port. Default: 8080. |
SPRING_PROFILES_ACTIVE | No | Spring Boot runtime profile. Recommended value: prod. |
Raw Editor example:
PORT=8080
SPRING_PROFILES_ACTIVE=prod
Persistent Storage
Railway Volumes are required to preserve application data.
Create the following volumes:
| Mount Path | Purpose |
|---|---|
/root/.zfile-v4/db | Embedded SQLite database |
/root/.zfile-v4/logs | Application logs |
/data/file | Local file storage |
Without these volumes, your database, configuration, logs, and uploaded files will be lost whenever the container is recreated.
Database
No external database is required.
ZFile uses an embedded SQLite database by default, stored in:
/root/.zfile-v4/db
Build & Start
The official Docker image contains everything needed to run ZFile.
No custom build or start commands are required.
Accessing the Application
After deployment:
- Open your Railway service.
- Navigate to Settings → Networking.
- Click Generate Domain.
- Open the generated Railway URL in your browser.
On your first visit, the ZFile installation wizard will appear.
Enter:
- Project Name — Choose any name for your ZFile instance.
- Administrator Username — Create your administrator username.
- Administrator Password — Create a secure administrator password.
Click Start Install to initialize the application.
After installation, sign in using the administrator credentials you created and configure your storage providers from the ZFile administration panel.
Why Deploy ZFile 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 ZFile 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
zhaojun1998/zfile:latest
zhaojun1998/zfile:latest