---
title: "Seafile Docker Compose and one-click hosting"
description: "Seafile is open-source file sync and share: libraries synced to every device, with file history, share links and encryption. Self-host it in one click."
---

[← All templates](https://pethost.dev/templates/) · [Files and documents](https://pethost.dev/templates/files/)

# Deploy Seafile in one click

File sync and share: libraries synced to your computers and phones, with history and links

A self-hosted alternative to Dropbox and Google Drive.

[Deploy on Pethost](https://console.pethost.dev/?template=seafile)

## What is Seafile?

Seafile is open-source software for syncing and sharing files, run in place of Dropbox or Google Drive. Files live in libraries: each one syncs to the desktop app on Windows, macOS and Linux, and the apps for iOS and Android browse and upload. Seafile keeps the history of every file, so an earlier version or a deleted file comes back, and a library can be encrypted with a password of its own, so the server stores only what it cannot read.

Libraries are shared with users and groups, read-only or to edit, and a share link gives a file or a folder to anyone, with a password and an expiry if you like; an upload link lets others drop files in. Seafile is known for syncing large numbers of files quickly: it transfers only the blocks of a file that changed.

This template runs the Community Edition from Seafile's official image, version 14.0, with MariaDB and a Redis cache. The databases and the admin, from the email and password you give, are made at the first start; sign-up stays off. SeaDoc, Seafile's online document editor, and its notification and metadata servers are not included.

## Hosting Seafile on Pethost

1. You sign in to Pethost with a passkey, GitHub or Google. No machine yet? You pick a plan, and the link waits until it is ready.
2. New project opens at Seafile. You fill in what it asks for and click Create project: **Email**, **Admin password**.
3. In a minute or two Seafile is live at its own address with HTTPS. Its secrets are made at random, and its data is in the nightly backup.
4. It is a project like any other: you or your agent can change it, roll it back or restore it.

## Questions about Seafile

**Is Seafile free and open source?**

Yes. Seafile's Community Edition is open source: the server under the AGPL-3.0 and its web interface, Seahub, under the Apache License 2.0. Seafile Ltd. also sells a Professional Edition with features for larger organisations.

**Seafile vs Nextcloud: which should I pick?**

Seafile does one thing, file sync and share, and is known for syncing fast with little memory. Nextcloud is a larger suite, with calendar, contacts, office and many apps around its files, and needs more resources.

**Does Seafile encrypt my files?**

It can. An encrypted library is encrypted on your computer with a password you choose, and the server keeps only the encrypted blocks. Without the password, even the server's admin cannot read the files.

**Which apps work with Seafile?**

Seafile's own desktop sync client for Windows, macOS and Linux, SeaDrive, which shows libraries as a network drive without downloading them first, and the Seafile apps for iOS and Android. Each signs in with the server's address and your account.

**Can I get back a deleted or older file in Seafile?**

Yes. Each library keeps the history of its files: History on a file shows its earlier versions, and the library's trash keeps deleted files and folders for restore. How long history is kept is set per library.

**How much memory and disk does Seafile need?**

Seafile takes about 750 MB of memory with MariaDB and its cache; your files take what they take, plus their history. On Pethost the Starter plan is enough for it, with room for other apps beside it.

## Seafile Docker Compose file

The template is this compose.yaml and the variables written into the project’s .env as it is created. Pethost runs the file as it is written.

**Containers:** seafile (seafileltd/seafile-mc:14.0-latest), db (mariadb:10.11), redis (redis:8-alpine).

**Volumes, in the nightly backup:** data, db.

```
services:
  seafile:
    image: seafileltd/seafile-mc:14.0-latest
    restart: unless-stopped
    environment:
      SEAFILE_SERVER_HOSTNAME: ${HOST}
      # HTTPS ends at the machine's proxy: Seafile writes https:// into its links.
      SEAFILE_SERVER_PROTOCOL: https
      SITE_ROOT: /
      CSRF_TRUSTED_ORIGINS: ${URL}
      JWT_PRIVATE_KEY: ${JWT_PRIVATE_KEY}
      TIME_ZONE: Etc/UTC
      SEAFILE_MYSQL_DB_HOST: db
      SEAFILE_MYSQL_DB_PORT: "3306"
      SEAFILE_MYSQL_DB_USER: seafile
      SEAFILE_MYSQL_DB_PASSWORD: ${DB_PASSWORD}
      SEAFILE_MYSQL_DB_CCNET_DB_NAME: ccnet_db
      SEAFILE_MYSQL_DB_SEAFILE_DB_NAME: seafile_db
      SEAFILE_MYSQL_DB_SEAHUB_DB_NAME: seahub_db
      # The first start makes the databases with MariaDB's root, and the admin from the fields;
      # later starts read neither. Seafile has no sign-up unless an admin turns it on.
      INIT_SEAFILE_MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
      INIT_SEAFILE_ADMIN_EMAIL: ${ADMIN_EMAIL}
      INIT_SEAFILE_ADMIN_PASSWORD: ${ADMIN_PASSWORD}
      CACHE_PROVIDER: redis
      REDIS_HOST: redis
      REDIS_PORT: "6379"
      REDIS_PASSWORD: ""
      ENABLE_GO_FILESERVER: "true"
      # SeaDoc, the notification server and the metadata server run as containers of their own,
      # which this template leaves out.
      ENABLE_SEADOC: "false"
      ENABLE_NOTIFICATION_SERVER: "false"
      ENABLE_METADATA_MANAGEMENT: "false"
      ENABLE_SEAFDAV: "false"
      NON_ROOT: "false"
      SEAFILE_LOG_TO_STDOUT: "true"
    volumes:
      - data:/shared
    healthcheck:
      test: ["CMD-SHELL", "curl -fsS -o /dev/null http://localhost:80/api2/ping/"]
      interval: 15s
      timeout: 10s
      retries: 20
      start_period: 120s
    depends_on:
      db:
        condition: service_healthy
      redis:
        condition: service_started

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

  # Seafile's cache: nothing in it is kept.
  redis:
    image: redis:8-alpine
    restart: unless-stopped
    command: ["redis-server", "--save", "", "--appendonly", "no", "--maxmemory", "64mb", "--maxmemory-policy", "allkeys-lru"]

volumes:
  data:
  db:
```

[compose.yaml](https://pethost.dev/templates/seafile/compose.yaml)[See it on GitHub](https://github.com/pethost-dev/templates/tree/main/seafile)

## [More in Files and documents](https://pethost.dev/templates/files/)

- [**Nextcloud**File sync, calendar and contacts on a server of your own](https://pethost.dev/templates/nextcloud/)
- [**Paperless-ngx**A document archive with OCR and full-text search](https://pethost.dev/templates/paperless-ngx/)
- [**BentoPDF**PDF tools in the browser: merge, split, compress, sign, convert and edit, with the files never leaving it](https://pethost.dev/templates/bentopdf/)
- [**copyparty**A file server in the browser: resumable uploads, a media player and share links, with WebDAV](https://pethost.dev/templates/copyparty/)
- [**Gopeed**A fast download manager in the browser: HTTP, BitTorrent and magnet links, with extensions](https://pethost.dev/templates/gopeed/)
- [**OpenList**One file list over many storages: cloud drives, S3, WebDAV and more, browsed, previewed and shared in the browser](https://pethost.dev/templates/openlist/)

Pethost · Stephan Gomer · NIP 1133096755

Pethost

- [Templates](https://pethost.dev/templates/)
- [About](https://pethost.dev/about/)
- [Docs](https://pethost.dev/docs/)
- [Blog](https://pethost.dev/blog/)
- [API](https://pethost.dev/docs/api/)
- [CLI](https://pethost.dev/docs/cli/)
- [Plugin](https://github.com/pethost-dev/plugin)
- [Terms](https://pethost.dev/terms/)
- [Privacy](https://pethost.dev/privacy/)
- [Refunds](https://pethost.dev/refunds/)
- [support@pethost.dev](mailto:support@pethost.dev)

Databases

- [Postgres](https://pethost.dev/postgres/)

Comparisons

- [Coolify vs Dokploy vs CapRover vs Dokku](https://pethost.dev/blog/coolify-vs-dokploy-vs-caprover-vs-dokku/)
- [Coolify Cloud vs Dokploy Cloud](https://pethost.dev/blog/coolify-cloud-vs-dokploy-cloud/)
- [Railway vs Render vs Fly.io pricing](https://pethost.dev/blog/railway-vs-render-vs-fly-io-pricing/)
- [Managed Docker Compose hosting](https://pethost.dev/blog/managed-docker-compose-hosting/)

Alternatives

- [Railway alternatives](https://pethost.dev/blog/railway-alternatives/)
- [Heroku alternatives](https://pethost.dev/blog/heroku-alternatives/)
- [Dokploy alternatives](https://pethost.dev/blog/dokploy-alternatives/)
- [Coolify alternatives](https://pethost.dev/blog/coolify-alternatives/)
- [Render alternatives](https://pethost.dev/blog/render-alternatives/)
- [Sliplane alternatives](https://pethost.dev/blog/sliplane-alternatives/)
