Railway

Deploy ZFile

Deploy and Host ZFile with Railway

Deploy ZFile

zhaojun1998/zfile:latest

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

DependencyRequiredPurpose
Docker ImageYesRuns the ZFile application
Railway VolumesYesStores the database, logs, and local files

Deployment Dependencies

ResourceLink
Official Websitehttps://www.zfile.vip/
GitHub Repositoryhttps://github.com/zfile-dev/zfile
Docker Deployment Guidehttps://docs.zfile.vip/install/os-docker
Docker Hub Imagehttps://hub.docker.com/r/zhaojun1998/zfile
Live Demohttps://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
SettingValue
Proxy TypeHTTP Proxy
Target Port8080

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.

VariableRequiredDescription
PORTNoInternal application listening port. Default: 8080.
SPRING_PROFILES_ACTIVENoSpring 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 PathPurpose
/root/.zfile-v4/dbEmbedded SQLite database
/root/.zfile-v4/logsApplication logs
/data/fileLocal 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:

  1. Open your Railway service.
  2. Navigate to Settings → Networking.
  3. Click Generate Domain.
  4. 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

More templates in this category

View Template
Garage S3 Storage
Ultra-light S3 server: fast, open-source, plug-and-play.

PROJETOS
7
View Template
Redis
Self Host Latest Redis with Railway

Arloodots
1
View Template
Postgres Backup to Cloudflare R2 (S3-Compatible)
Automated PostgreSQL backups to S3-compatible storage with encryption

Artour
7