Skip to content

Set Up Seafile on a Linux Server – Your Own Cloud for Fast File Sync and Sharing

Seafile on a Linux server: use the One-Click App or Docker Compose, with libraries, sharing, desktop and mobile clients, and encryption.

30 November 202614 min read1 Views0 helpful

Introduction

Seafile is open-source software for file synchronization and sharing. Your files are stored in libraries on your own server. You can sync each library with the desktop client on as many computers as you like, open it in the smartphone app or a browser, and share it with other users, groups, or through a link. If you want, you can encrypt individual libraries with a password of your own. This makes Seafile a replacement for Dropbox, Google Drive, or OneDrive for you, your family, or your team. In this guide, we’ll show you two ways to get started: the easy way with the One-Click App, which makes Seafile available over HTTPS in just a few clicks, and a manual installation with Docker Compose. After that, you’ll create libraries, share files, connect your desktop and smartphone, and set up an encrypted library.

When Seafile Makes Sense on a VPS

Seafile focuses on files and makes file sync fast and reliable. Seafile is a good fit on a VPS if:

  • You want to keep files synchronized between multiple computers without giving your data to a cloud provider. When a file changes, Seafile transfers only the parts that have changed, saving time and bandwidth.
  • You synchronize large amounts of data or many small files. Seafile stores files in blocks using its own database and stays fast even with tens of thousands of files.
  • You want to share folders separately: Each library has its own shares, history, and trash.
  • Some folders are especially confidential. Encrypted libraries are encrypted on your device, so even the server admin can’t read their contents without the password.
  • You want to share files by link or collect uploads from others, with a password and expiration date.

Seafile is less suitable if you also expect calendars, contacts, browser-based office editing, video conferences, or hundreds of extensions in addition to files. Nextcloud is a better choice for that, and is also available in the app catalog. Seafile is more lightweight and usually faster at syncing, while Nextcloud offers significantly more apps for working with files.

Seafile or Nextcloud?

Both are available as a One-Click App, and both synchronize files with desktop and smartphone apps. The difference is what they focus on:

SeafileNextcloud
FocusFile sync and sharingFiles plus calendars, contacts, office, Talk, and many apps
File storageLibraries, stored internally in blocksRegular folders and files on the server
EncryptionPer library, on the user’s deviceServer-side encryption as an app
ExtensibilityLimited, deliberately lightweightExtensive (App Store)

Choose Seafile if your main goal is to keep files synchronized quickly and reliably. Choose Nextcloud if you need a complete workspace with a calendar and office tools. Note that Seafile does not store files as regular files on the server. You access them through Seafile, not directly using SSH or SFTP.

The Easy Way: Seafile as a One-Click App

The fastest way to get Seafile is through your VPS’s One-Click Apps. The app runs with your domain directly over HTTPS, sets up MariaDB and Memcached, configures the upload and download addresses for your domain, and automatically generates the admin password. You don’t need to set up a reverse proxy, certificate, or firewall rules.

Requirements

  • A Linux VPS (Debian or Ubuntu) with One-Click Apps set up. See Set Up One-Click Apps for instructions.
  • At least 2 GB of RAM and 2 vCPU cores; 4 GB of RAM is recommended. Immediately after startup, Seafile, MariaDB, and Memcached use about 1 GB of RAM combined.
  • Enough storage for your files. Seafile itself needs only a few GB; the rest is for your data. Allow space for the history of older file versions.

Install

  1. Open your VPS in the ZapX dashboard and go to the One-Click Apps tab.
  2. Search the app catalog for Seafile and click Install app.
  3. Use a custom subdomain or zap.cloud is already selected with a randomly generated name. Leave the option selected or enter a name of your own, such as cloud or files. Seafile needs a domain with HTTPS for clients and upload links to work.
  4. Open App configuration. You don’t need to fill anything in, but you should change one setting: Enter your own email address for INIT_SEAFILE_ADMIN_EMAIL. This will be your username for the admin login. If you don’t change it, the admin account will be test@example.com. You can enter Europe/Berlin for TIME_ZONE. Leave the other values, such as the database names, SITE_ROOT, NON_ROOT, and ENABLE_SEADOC, at their default settings.
  5. Click Queue installation.

Installation takes a few minutes. On the first startup, Seafile creates its three databases. Seafile is ready when the app card shows Online.

First Login: Find Your Login Details

  1. Click the gear icon on the app card and go to App environment.
  2. Under Automatically generated values, find SERVICE_PASSWORD_ADMIN, the admin account password. Click the eye icon to view it or the icon next to it to copy it. Your username is the email address from INIT_SEAFILE_ADMIN_EMAIL earlier on the same page.
  3. Open your app using the Access link and sign in with your email address and password.

When you log in for the first time, Seafile briefly shows a welcome message and has already created the My Library library for you. The default login details found in many online examples (me@example.com / asecret) are not used by the One-Click App. The password is randomly generated.

Warning: Admin login details are only set on first startup

Seafile reads INIT_SEAFILE_ADMIN_EMAIL and SERVICE_PASSWORD_ADMIN only during the very first installation. Changing them later in App environment will not change the account. To change your password in Seafile, click your profile picture in the top-right corner, then Settings, and click Update in the Password section.

If you didn’t change the email address during installation, create an account with your real email address under System Admin > Users, give it admin privileges, and use that account from then on. You’ll need the email address, for example, if you want to reset your password later.

What the App Sets Up for You

  • Upload and download addresses: Seafile builds upload and download links from SEAFILE_SERVER_HOSTNAME and SEAFILE_SERVER_PROTOCOL. The One-Click App sets both to match your domain and use https. Incorrect values here are the most common reason for browser uploads failing. Don’t change these values.
  • Large files: Tests confirmed that uploads and downloads of a 300 MB file, as well as uploads through the web interface, worked without any changes.
  • Registration disabled: New users can’t sign up on their own. As an admin, you create accounts; see below.
  • SeaDoc disabled: The editor for Seafile’s own documents (ENABLE_SEADOC) is disabled by default because it would get a separate address without HTTPS. This doesn’t affect regular files such as office documents, PDFs, and images.
  • WebDAV disabled: Seafile displays a WebDAV address in your profile, but the WebDAV service is disabled by default. Use the Seafile clients instead.

Updates and backups

Update Seafile in the app settings (gear icon) under App update. Click Check for updates and install a new version with Apply update. If it says that the app is up to date, there isn’t a newer version in the app catalog yet. The app uses Seafile 12.

Warning: Back up before updating

When a new version starts, Seafile updates its databases. After that, you can only go back to the old version by restoring a backup. Back up your VPS first, for example, using Backups in the dashboard.

Your files, databases, and settings are stored in the app’s own volumes and are retained during updates. If you uninstall the app and select Also delete data volumes, all your files will be deleted.

Manual Installation

The rest of this guide covers the manual installation of Seafile with Docker Compose on your VPS—for example, if you don’t use One-Click Apps on your server or want to run Seafile behind your own reverse proxy. This guide is based on the official Docker template in the Seafile documentation for version 12.

Requirements

  • A Linux VPS running Debian or Ubuntu, with SSH access. See First Access via SSH.
  • Docker and Docker Compose (Compose v2). See Install Docker. Check the installation with docker --version and docker compose version.
  • A domain or subdomain whose A record points to your VPS’s IP address (e.g. seafile.example.com).

The official documentation recommends at least 2 GB of RAM and 2 CPU cores. Storage requirements depend almost entirely on your files.

HardwareMinimumRecommended
CPU2 vCPU cores2 vCPU cores
RAM2 GB4 GB
Storage10 GB plus your data20 GB plus your data

Prepare the Firewall

Seafile listens on port 80 inside the container. In this guide, you’ll publish it only on 127.0.0.1:8000, so Seafile will be accessible from outside only through the reverse proxy. With ufw, allow only SSH and the ports used by the reverse proxy:

Code
ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable
Warning: Docker bypasses ufw

Ports published by Docker with ports: are accessible from outside even if ufw blocks them. So, as shown below, bind Seafile only to 127.0.0.1. For more information about the firewall, see Open Ports and Manage the Firewall on Linux.

Install with Docker Compose

Create a directory and generate the secrets. These commands write them directly to the .env file without displaying them:

Code
mkdir -p /opt/seafile
cd /opt/seafile
echo "DB_ROOT_PASSWORD=$(openssl rand -hex 24)" >> .env
echo "DB_PASSWORD=$(openssl rand -hex 24)" >> .env
echo "ADMIN_PASSWORD=$(openssl rand -hex 16)" >> .env
echo "JWT_PRIVATE_KEY=$(openssl rand -hex 32)" >> .env
echo "ADMIN_EMAIL=admin@example.com" >> .env
echo "SEAFILE_HOSTNAME=seafile.example.com" >> .env
chmod 600 .env

Next, replace the example values for ADMIN_EMAIL and SEAFILE_HOSTNAME in .env with your email address and domain using nano .env. Then create the docker-compose.yml file and add this content:

Code
services:
  db:
    image: mariadb:10.11
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
      MARIADB_AUTO_UPGRADE: "1"
    volumes:
      - ./mysql:/var/lib/mysql
    healthcheck:
      test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
      interval: 10s
      retries: 10

  memcached:
    image: memcached:1.6
    restart: unless-stopped
    entrypoint: memcached -m 256

  seafile:
    image: seafileltd/seafile-mc:12.0-latest
    restart: unless-stopped
    ports:
      - "127.0.0.1:8000:80"
    volumes:
      - ./seafile-data:/shared
    environment:
      DB_HOST: db
      DB_PORT: "3306"
      DB_USER: seafile
      DB_ROOT_PASSWD: ${DB_ROOT_PASSWORD}
      DB_PASSWORD: ${DB_PASSWORD}
      TIME_ZONE: Europe/Berlin
      INIT_SEAFILE_ADMIN_EMAIL: ${ADMIN_EMAIL}
      INIT_SEAFILE_ADMIN_PASSWORD: ${ADMIN_PASSWORD}
      SEAFILE_SERVER_HOSTNAME: ${SEAFILE_HOSTNAME}
      SEAFILE_SERVER_PROTOCOL: https
      JWT_PRIVATE_KEY: ${JWT_PRIVATE_KEY}
      ENABLE_SEADOC: "false"
    depends_on:
      db:
        condition: service_healthy
      memcached:
        condition: service_started

Here’s what the important lines mean:

  • seafileltd/seafile-mc:12.0-latest: The official Community Edition image. The 12.0-latest tag gives you bug fixes within version 12.
  • DB_ROOT_PASSWD: On first startup, Seafile uses the root password to create the ccnet_db, seafile_db, and seahub_db databases, as well as the seafile user.
  • INIT_SEAFILE_ADMIN_EMAIL and INIT_SEAFILE_ADMIN_PASSWORD: Create the admin account on first startup. If you don’t set them, the official template uses me@example.com with the password asecret. These credentials are widely known, so always set your own values.
  • SEAFILE_SERVER_HOSTNAME and SEAFILE_SERVER_PROTOCOL: Your domain without https://, and the protocol. Seafile uses these to create all links, including the upload and download address under /seafhttp. If this is set to http or the wrong domain, uploads will fail in the browser and clients.
  • JWT_PRIVATE_KEY: A secret key of at least 32 characters that Seafile uses internally for signing.
  • 127.0.0.1:8000:80: Seafile is accessible only from the server itself, and from outside only through the reverse proxy.

Pull the images and start Seafile:

Code
docker compose pull
docker compose up -d
docker compose logs -f seafile

The first startup takes one to two minutes. Seafile is ready when curl http://127.0.0.1:8000/api2/ping/ returns "pong". Exit the log view with Ctrl+C.

First Visit

First, set up the reverse proxy in the next section, because Seafile creates all links using your domain and https. Then open https://seafile.example.com and sign in with the email address and password from .env. To view the password on the server, run grep ADMIN_PASSWORD /opt/seafile/.env. After your first login, change it in Seafile under Settings > Password.

Access over HTTPS Through a Reverse Proxy

To access Seafile from outside, set up nginx with a valid certificate in front of it. For the basics, see Set Up a Reverse Proxy with nginx and Create an SSL Certificate (Let's Encrypt). Here’s a server block for Seafile:

Code
server {
    listen 80;
    server_name seafile.example.com;

    client_max_body_size 0;

    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_request_buffering off;
        proxy_read_timeout 1200s;
    }
}

Then obtain the certificate with certbot --nginx -d seafile.example.com. Certbot will add HTTPS and HTTP redirection to the block. Three lines are important: client_max_body_size 0 removes nginx’s upload limit, which otherwise causes uploads to fail at just 1 MB with “413 Request Entity Too Large.” proxy_request_buffering off forwards uploads directly to Seafile instead of temporarily storing them on nginx’s disk. The long proxy_read_timeout prevents interruptions during large file transfers.

For more security tips, see Linux Security Tips.

Back Up Your Data

According to the documentation, a full backup consists of the three databases and the data directory. Back up the databases first, then the files:

Code
cd /opt/seafile
mkdir -p backup
for db in ccnet_db seafile_db seahub_db; do
  docker compose exec -T db sh -c "mariadb-dump -uroot -p\"\$MYSQL_ROOT_PASSWORD\" --opt $db" > backup/$db.sql
done
tar czf backup/seafile-data-$(date +%F).tar.gz seafile-data

Also back up .env and docker-compose.yml, and copy the backup to another computer or storage location. Restoring is much more difficult without the .env file containing JWT_PRIVATE_KEY and the passwords.

Update Seafile

Back up your databases and data first. To install updates within version 12, run:

Code
cd /opt/seafile
docker compose pull
docker compose up -d

To upgrade to a new major version, change the image tag, for example to 13.0-latest. First, read the documentation’s upgrade guide, because variables and procedures can change between major versions. Deleted files free up storage only after garbage collection. If needed, start it with docker compose exec seafile /scripts/gc.sh.

Using Seafile: Libraries, Sharing, and Clients

After setup, you’ll work with libraries in Seafile. The following steps are the same for the One-Click App and the manual installation.

Create Libraries and Upload Files

A library is a top-level folder with its own shares, history, and trash. Create separate libraries for different topics, such as “Photos,” “Documents,” and “Team,” instead of putting everything into one library. That way, you can sync and share each one individually later.

  1. Under Files, click New Library next to My Libraries, enter a name, and confirm.
  2. Open the library. Click the + next to its name and select Upload Files or Upload Folder. Alternatively, simply drag files into the browser window.
  3. Seafile shows the progress in the bottom-right corner and displays “All files uploaded” when it’s done.

Each library keeps older file versions. Use History in the library’s left sidebar to restore an earlier version; find deleted files under Trash.

Share Files

  • With users or groups: Hover over a library or folder and select Share. Share it with individual users or a group, and choose whether they can read only or also make changes.
  • By link: In the same dialog, create a sharing link, optionally with a password and expiration date. Anyone with the link can download the file without an account.
  • Upload link: This lets other people upload files to a folder without seeing its existing contents.

As an admin, create new users by clicking your profile picture in the top-right corner, then System Admin, Users, and Add User. If you want users to register themselves, enable Allow new registrations under System Admin > Settings. Leave it disabled if Seafile is publicly accessible.

Connect Your Desktop and Smartphone

Download the clients from the official download page. There are two desktop options:

  • Seafile Client (Windows, macOS, Linux) synchronizes selected libraries to a local folder. The files are then available offline on your computer.
  • SeaDrive mounts your libraries as a drive and downloads files only when you open them. This saves space on your computer.

To connect a client:

  1. Start the client and enter your server address with https://, for example, https://cloud-1234.zap.cloud or https://seafile.example.com.
  2. Sign in with your email address and password.
  3. In the Seafile Client, select a library and click Sync to connect it to a local folder.

On your smartphone, use the Seafile app for Android or iOS with the same login details. You can also set it to automatically upload photos and videos to a library. See which devices are connected in your profile under Linked Devices. You can also disconnect a lost device there.

Encrypted Libraries

When creating a library, select the encryption option and set a password of your own. The files are then encrypted on your device before they’re sent to the server. The server does not store the password, and even the admin can’t read the contents without it.

Warning: Lose the password, lose the data

No one can reset the password for an encrypted library, including you as the admin. Keep it in a password manager, such as Vaultwarden.

There are some limitations: File contents are encrypted, but the server can still see filenames and folder structure. If you open an encrypted library in a browser, you send the password to the server, where it is kept in memory temporarily. For maximum confidentiality, open these libraries only in the desktop client. You can’t create sharing links for encrypted libraries.

Limitations

  • No direct access to files on the server: Seafile stores files internally in blocks. You can’t edit the data directly over SFTP or simply add an existing folder on the server. New files must always be added through Seafile.
  • Storage is freed up later: Deleted files remain in the trash and history first. Set how long they’re kept for each library under Settings. Space is freed permanently only after garbage collection.
  • No groupware: There are no calendars, contacts, or video conferences. You can edit office files only by connecting an additional office server, which isn’t part of this installation.
  • WebDAV and SeaDoc are disabled: Both are disabled by default in the One-Click App. Use the Seafile clients to access your files.

Conclusion

You’ve set up Seafile on your VPS, signed in with the admin account, created libraries, shared files, and connected your desktop and smartphone. Encrypted libraries give you an extra way to protect especially confidential folders.

Prefer not to handle Docker yourself? Use the easy One-Click App option described above in “The Easy Way: Seafile as a One-Click App.”

Free tools

Related tools for servers and developers

View all

FAQ

Frequently asked questions

The One-Click App is the fastest option: Seafile runs over HTTPS on your domain in just a few minutes, MariaDB and Memcached are set up, upload and download addresses are configured automatically, and the admin password is randomly generated. You can install updates from the dashboard. A manual installation with Docker Compose makes sense if you don’t use One-Click Apps on your server, want to run Seafile behind your own reverse proxy, or want to manage the version yourself.
Click the gear icon on the app card and open App environment. Under Automatically generated values, you’ll find SERVICE_PASSWORD_ADMIN, the admin password. Your username is the email address set in INIT_SEAFILE_ADMIN_EMAIL on the same page. If you didn’t change it during installation, it’s test@example.com. The default credentials me@example.com and asecret found in many guides aren’t used by the One-Click App.
Both are available in the app catalog. Seafile focuses on file synchronization and sharing, is more lightweight, and usually syncs large amounts of data faster. Nextcloud also offers calendars, contacts, browser-based office tools, Talk, and many other apps. Choose Seafile if you mainly need fast file sync, or Nextcloud for a complete workspace.

Feedback

Was this article helpful?

Your feedback helps us prioritize and improve content.

0 of 0 people found this article helpful.

Personal support

Need more help than the guide provides?

Our ZAP-Hosting support team knows your product — briefly describe your issue and we'll help you personally.

Zappy knows this guide and answers you right in the chat.