Seafile logo

Seafile

Open source file sync, sharing, and cloud storage platform with client-side encryption

Alternative to: dropbox, google drive, onedrive, box


Seafile is an open source cloud storage system with privacy protection and teamwork features. Files are organized into libraries that can be synced and shared independently, with optional client-side encryption for privacy. It supports selective syncing, file version history, group collaboration, and built-in document and wiki tools for team knowledge management.

Seafile Docker Compose example

Self-host Seafile on your own server, homelab, or VPS starting from this Docker Compose example. It runs Seafile in Docker containers using the official mariadb:10.11, memcached:1.6, seafileltd/seafile-mc:12.0-latest images, with persistent volumes and automatic restarts preconfigured. Review the environment variables and adjust them to your setup, save the file as compose.yml (or docker-compose.yml), and start the stack with docker compose up -d.

services:
  db:
    image: mariadb:10.11
    restart: unless-stopped
    environment:
      # Root password for the bundled MariaDB. Internal-only — the database is
      # never published outside the compose network. Used on first boot to
      # create the Seafile databases and user.
      MYSQL_ROOT_PASSWORD: "changeme"
      MYSQL_LOG_CONSOLE: "true"
      MARIADB_AUTO_UPGRADE: "1"
    volumes:
      - db_data:/var/lib/mysql
    healthcheck:
      test: ["CMD", "/usr/local/bin/healthcheck.sh", "--connect", "--mariadbupgrade", "--innodb_initialized"]
      interval: 20s
      start_period: 30s
      timeout: 5s
      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
    depends_on:
      db:
        condition: service_healthy
      memcached:
        condition: service_started
    volumes:
      - seafile_data:/shared
    environment:
      DB_HOST: "db"
      DB_PORT: "3306"
      DB_USER: "seafile"
      # Must match MYSQL_ROOT_PASSWORD above; used only on first boot to create
      # the Seafile databases.
      DB_ROOT_PASSWD: "changeme"
      # Password for the 'seafile' database user (internal-only).
      DB_PASSWORD: "changeme"
      SEAFILE_MYSQL_DB_CCNET_DB_NAME: "ccnet_db"
      SEAFILE_MYSQL_DB_SEAFILE_DB_NAME: "seafile_db"
      SEAFILE_MYSQL_DB_SEAHUB_DB_NAME: "seahub_db"
      # Server time zone (e.g. Europe/Berlin, America/New_York).
      TIME_ZONE: "Etc/UTC"
      # Email address of the initial administrator account created on first boot.
      INIT_SEAFILE_ADMIN_EMAIL: "me@example.com"
      # Password for the initial administrator account created on first boot.
      INIT_SEAFILE_ADMIN_PASSWORD: "changeme"
      # Public hostname or domain where Seafile is reached (no protocol, no path).
      SEAFILE_SERVER_HOSTNAME: "seafile.example.com"
      # Protocol used to reach Seafile: http or https.
      SEAFILE_SERVER_PROTOCOL: "http"
      SITE_ROOT: "/"
      NON_ROOT: "false"
      # Random secret, at least 32 characters, used to sign internal JWT tokens
      # between Seafile components.
      JWT_PRIVATE_KEY: "please-change-me-to-a-random-string-min-32-chars"
      SEAFILE_LOG_TO_STDOUT: "false"
      ENABLE_SEADOC: "false"

volumes:
  db_data:
  seafile_data:

Values set to changeme are required — replace them with your own values before starting Seafile.

Prefer a managed setup? WinterFlow installs, configures, and updates Seafile for you using this same Docker Compose configuration.