---
title: "Deploy ZFile"
description: "Deploy and Host ZFile with Railway"
category: "Storage"
url: https://railway.com/deploy/zfile
---

# Deploy ZFile

Deploy and Host ZFile with Railway

**[Deploy ZFile on Railway](https://railway.com/template/zfile)**

- **Creator:** Muhammad Bilal
- **Category:** Storage

## Template content

### zhaojun1998/zfile:latest

- **Image:** zhaojun1998/zfile:latest
- **Public domain:** Yes

## Documentation

# 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/](https://www.zfile.vip/)                                         |
| GitHub Repository       | [https://github.com/zfile-dev/zfile](https://github.com/zfile-dev/zfile)                 |
| Docker Deployment Guide | [https://docs.zfile.vip/install/os-docker](https://docs.zfile.vip/install/os-docker)     |
| Docker Hub Image        | [https://hub.docker.com/r/zhaojun1998/zfile](https://hub.docker.com/r/zhaojun1998/zfile) |
| Live Demo               | [https://demo.zfile.vip/](https://demo.zfile.vip/)                                       |

### Implementation Details

#### Docker

Deploy the official Docker image:

```docker
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:

```env
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:

```text
/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.


## Similar templates

- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.
- [Redis](https://railway.com/deploy/redis-1) — Self Host Latest Redis with Railway
- [EasyImg](https://railway.com/deploy/easyimg) — Simple self-hostable Nuxt.js personal image hosting system.

Open this page in a browser: https://railway.com/deploy/zfile
