Installing Seafile on a VPS to Create a Private Cloud Storage
TL;DR
In this detailed guide, we will step-by-step configure your own private Seafile cloud storage on a Virtual Private Server (VPS). You will learn how to prepare a server based on Ubuntu 24.04 LTS, install Seafile using Docker Compose, set up automatic HTTPS via Caddy, and ensure reliable data backup to gain full control over your files without relying on public cloud services.
- We will install Seafile Professional Edition 13.x with PostgreSQL and Caddy on Ubuntu 24.04 LTS.
- Automatic HTTPS will be configured for secure access to your cloud.
- You will gain a full understanding of the minimum VPS requirements for stable Seafile operation.
- We will cover basic server security measures and firewall configuration.
- The guide includes scripts for backing up Seafile data and the database.
What we are configuring and why
In an era of widespread cloud technologies, where our data is stored on third-party servers, the issue of privacy and control is more relevant than ever. We will configure Seafile – a powerful and high-performance solution for file synchronization and sharing, which you will install on your own VPS. This will allow you to create private cloud storage, fully controlled by you, without the need to entrust your confidential data to large corporations.
Ultimately, you will get a full-fledged alternative to Dropbox or Google Drive, but with the difference that all data will be on your server. This is an ideal solution for developers, startups, small teams, and individuals who need a reliable, secure, and scalable platform for storing and sharing files, as well as for collaborative document editing.
Why Seafile?
Seafile stands out among other solutions due to its architecture, which is focused on performance and reliability. It stores files as blocks, which ensures high synchronization speed, especially when working with large files or frequent changes. In addition, Seafile provides:
- High performance: Optimized for fast synchronization and access.
- Version control: Automatically saves file change history, allowing easy rollback to previous versions.
- Encryption: Supports server-side and, optionally, client-side data encryption for maximum privacy.
- Collaboration: Built-in tools for file commenting, collaborative editing (via integration with OnlyOffice/Collabora), and access management.
- Cross-platform: Clients for Windows, macOS, Linux, Android, and iOS, as well as a web interface.
Alternatives: Cloud-managed vs Self-hosted
There are two main approaches to cloud storage:
- Cloud-managed: These are services like Dropbox, Google Drive, OneDrive. They are easy to use, require no server setup, but you fully entrust your data to the provider, and you have no control over the infrastructure and security. The cost usually depends on the data volume and number of users.
- Self-hosted: These are solutions like Seafile, Nextcloud, Owncloud, which you install on your own server (VPS or dedicated). The main advantages are full control over data, privacy, the ability to customize to your needs, and no subscription fee for the service (only for the server). The disadvantage is that it requires technical knowledge for installation and maintenance.
We choose self-hosted Seafile on a VPS because it's the golden mean: you get full control and privacy at a relatively low cost and flexibility of a VPS, avoiding the complexities of purchasing and maintaining your own physical server.
What VPS configuration is needed for this task
Choosing the right VPS is a key factor for stable and productive Seafile operation. Requirements may vary depending on the number of users, the volume of data stored, and the intensity of use. Below are recommendations for various scenarios.
Minimum requirements for small teams (up to 10 users)
- Processor (CPU): 2 vCPU. Seafile is not too demanding on CPU for basic operations, but additional cores will help with file indexing or when multiple users are working simultaneously.
- Random Access Memory (RAM): 4 GB. This is sufficient for running Seafile, PostgreSQL, and Caddy Docker containers, as well as for data caching. If integrations with OnlyOffice/Collabora are planned, more RAM will be required.
- Disk (Storage): 100-200 GB SSD. SSD is critical for database performance and file access. The volume depends on the planned data volume. Keep in mind that Seafile stores file versions, which increases the required space.
- Network: 100 Mbps symmetric channel. For file synchronization, not only download speed but also upload speed is important.
For these purposes, you can choose a VPS with the specified characteristics, for example, with 2 vCPU, 4 GB RAM, and a 100 GB NVMe disk. Make sure the chosen provider offers a reliable channel and stable disk performance.
Recommended configuration for medium teams (10-50 users)
- Processor (CPU): 4 vCPU.
- Random Access Memory (RAM): 8-16 GB.
- Disk (Storage): 500 GB - 1 TB NVMe SSD. NVMe will provide maximum access speed.
- Network: 1 Gbps symmetric channel.
When a Dedicated Server is needed, not a VPS
A Dedicated Server becomes justified when:
- Very large number of users: More than 50 active users constantly working with files.
- Critical data and high load: Maximum performance, guaranteed resources, and low latency are required.
- Huge data volumes: Several terabytes or more, requiring special disk configurations (RAID).
- Strict security and compliance requirements: Some regulatory norms may require physical isolation of equipment.
- Integration with other services: If many other resource-intensive applications are planned to be hosted on the same server.
In this case, instead of a VPS, it is worth considering a suitable dedicated server to gain full control over the hardware and avoid "sharing" with other clients on the same physical server.
VPS location: what it affects
Choosing a VPS location is important for several reasons:
- Latency: The closer the server is to most of your users, the lower the ping and faster the response. This is critical for comfortable work with cloud storage.
- Legislation: Depending on the server's country of location, data may fall under various jurisdictions (e.g., GDPR in the EU). Ensure that the chosen location complies with your privacy requirements and legal norms.
- Connection speed: Some regions may have better backbone channels, which affects overall network performance.
Always choose a location that is geographically closer to the majority of your users and meets your data legislation requirements.
Server preparation
After you have gained access to your new VPS, you need to perform a series of basic settings to ensure system security and stability. We will be using Ubuntu 24.04 LTS (Noble Numbat), which will be a current and supported version in 2026.
1. Connecting via SSH
Use an SSH client to connect to your server. Replace your_vps_ip with your server's IP address and root with the username if your provider gave you a different one.
ssh root@your_vps_ip
Upon first connection, you will likely need to enter the root password.
2. System update
Always start by updating all packages to their latest versions.
sudo apt update && sudo apt upgrade -y
sudo apt autoremove -y # Remove unnecessary packages
3. Creating a new user with sudo privileges
Working as the root user is insecure. Create a new user and grant them sudo privileges.
sudo adduser seafileuser # Create a new user
sudo usermod -aG sudo seafileuser # Add them to the sudo group
Then, exit the root session and log in as the new user:
exit
ssh seafileuser@your_vps_ip
4. Setting up SSH keys (recommended)
For increased security, it is recommended to use SSH keys instead of passwords. Generate keys on your local machine (if you haven't already):
ssh-keygen -t ed25519 -C "[email protected]" # On your local machine
Copy the public key to the server:
ssh-copy-id seafileuser@your_vps_ip # On your local machine
After this, you can disable password authentication in /etc/ssh/sshd_config by setting PasswordAuthentication no and restarting the SSH service. Make sure you can log in with a key before disabling passwords!
5. Firewall configuration (UFW)
UFW (Uncomplicated Firewall) is an easy-to-use interface for iptables. Let's configure it to allow only necessary connections.
sudo apt install ufw -y # Install UFW
sudo ufw allow OpenSSH # Allow SSH (port 22)
sudo ufw allow http # Allow HTTP (port 80)
sudo ufw allow https # Allow HTTPS (port 443)
sudo ufw enable # Enable the firewall. Confirm with 'y'.
sudo ufw status # Check status
Now your server is protected from unwanted connections.
6. Installing Fail2Ban
Fail2Ban helps protect against brute-force password attacks by temporarily blocking IP addresses that have too many failed login attempts.
sudo apt install fail2ban -y # Install Fail2Ban
sudo systemctl enable fail2ban # Enable autostart
sudo systemctl start fail2ban # Start the service
Create a local configuration file for Fail2Ban so your changes are not overwritten during updates:
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
You can edit /etc/fail2ban/jail.local to configure parameters (e.g., ban time or number of retries). Make sure the [sshd] section is active (enabled = true).
# Example content of /etc/fail2ban/jail.local
[DEFAULT]
bantime = 10m
findtime = 10m
maxretry = 5
[sshd]
enabled = true
port = ssh
logpath = %(sshd_log)s
backend = %(sshd_backend)s
After making changes, restart Fail2Ban:
sudo systemctl restart fail2ban
Your server is now ready for Seafile installation.
Software Installation — Step-by-Step
To install Seafile, we will use Docker Compose. This is a modern and recommended approach that significantly simplifies the deployment and management of all components (Seafile, database, web server) in isolated containers. We will be using Seafile Professional Edition 13.x, the current version for 2026, which offers advanced features compared to the Community Edition.
1. Installing Docker and Docker Compose
First, let's install Docker Engine and Docker Compose on our server.
# Update the package list
sudo apt update
# Install necessary packages for Docker
sudo apt install ca-certificates curl gnupg lsb-release -y
# Add Docker's official GPG key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add Docker repository to APT sources
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Update the package list with the new Docker repository
sudo apt update
# Install Docker Engine, containerd, and Docker Compose
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
# Add the current user to the docker group to run commands without sudo
sudo usermod -aG docker $USER
# Reload user group (or reconnect via SSH)
newgrp docker
# Verify that Docker is installed correctly (should output the version)
docker --version
docker compose version
2. Creating Directories for Seafile
Let's create the directory structure for storing Seafile data and its configuration. This is important for data persistence.
sudo mkdir -p /opt/seafile
cd /opt/seafile
sudo mkdir -p {data,logs,db_data,conf} # Create directories for data, logs, DB, and configs
3. Creating the docker-compose.yml file
We will use the official Seafile Professional Edition image. Create the docker-compose.yml file in the /opt/seafile directory.
sudo nano docker-compose.yml
Insert the following content. This file defines three services: db (PostgreSQL), memcached (for caching), and seafile (the main Seafile service).
version: '3.8'
services:
db:
image: postgres:15 # Current PostgreSQL version for 2026
container_name: seafile-db
environment:
- POSTGRES_USER=seafile
- POSTGRES_PASSWORD=your_db_password # Change to a strong password!
- POSTGRES_DB=seafile
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- /opt/seafile/db_data:/var/lib/postgresql/data/pgdata # Persistent DB data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U seafile -d seafile"]
interval: 10s
timeout: 5s
retries: 5
memcached:
image: memcached:1.6 # Current Memcached version
container_name: seafile-memcached
restart: unless-stopped
seafile:
image: seafileltd/seafile-pro:13.0.0 # Current Seafile Professional version (example, use the latest)
container_name: seafile
ports:
- "8000:8000" # Port for Seafile HTTP (for internal Caddy use)
- "8082:8082" # Port for Seafile file server
volumes:
- /opt/seafile/data:/shared # Main directory for Seafile data
- /opt/seafile/logs:/var/log/seafile # Directory for logs
- /opt/seafile/conf:/opt/seafile/conf # Directory for configuration files
environment:
- DB_HOST=db
- DB_ROOT_PASSWD=your_db_password # PostgreSQL password, must match POSTGRES_PASSWORD
- [email protected] # Your administrator email
- SEAFILE_ADMIN_PASSWORD=your_admin_password # Seafile administrator password (Change!)
- SEAFILE_SERVER_HOSTNAME=your.domain.com # Your domain
- SEAFILE_SERVER_URL=https://your.domain.com # URL for access
- TIME_ZONE=Europe/Moscow # Set your timezone
- SEAFILE_IMAGE_VERSION=13.0.0 # Seafile image version
depends_on:
db:
condition: service_healthy # Start Seafile only after DB is ready
memcached:
condition: service_started
restart: unless-stopped
IMPORTANT:
- Replace
your_db_passwordwith a strong, complex password. - Replace
[email protected]with your actual email. - Replace
your_admin_passwordwith a strong, complex password for the Seafile administrator. - Replace
your.domain.comwith your domain name that you will use to access Seafile. Ensure that the DNS A record for this domain points to your VPS's IP address. - Check the current version of
seafileltd/seafile-proon Docker Hub or the official Seafile website and use it instead of13.0.0if a newer version is available.
4. Starting Seafile
Now that docker-compose.yml is ready, you can start the containers.
cd /opt/seafile
sudo docker compose up -d # Start containers in detached mode
Wait a few minutes for all containers to start and Seafile to perform initial initialization. You can check the status of the containers:
sudo docker compose ps
All services (seafile-db, seafile-memcached, seafile) should be in the running state.