docker.recipes

Seafile File Sync & Share

intermediate

Enterprise file sync and share platform with versioning, encryption, and team collaboration.

Overview

Seafile is an enterprise-grade open-source file synchronization and sharing platform developed by a team that previously worked on version control systems, bringing Git-like versioning concepts to file management. Originally created in 2012, Seafile distinguishes itself from competitors like Nextcloud or ownCloud through its unique block-level deduplication, client-side encryption capabilities, and distributed architecture that can scale to handle millions of files efficiently. The platform offers desktop clients for Windows, Mac, and Linux, mobile apps for iOS and Android, and a comprehensive web interface for browser-based access. This stack combines Seafile with MariaDB for metadata storage, Memcached for session and object caching, and relies on Seafile's built-in web server for HTTP handling. MariaDB stores all file metadata, user information, and sharing permissions while the actual file data is stored in Seafile's proprietary storage format with block-level deduplication. Memcached accelerates the system by caching frequently accessed database queries, user sessions, and file metadata, significantly improving response times for large deployments with hundreds of concurrent users. This configuration targets organizations requiring enterprise-level file collaboration with strong security controls, detailed audit trails, and the ability to maintain complete data sovereignty. Unlike cloud-based solutions, this self-hosted stack gives administrators full control over encryption keys, data location, and compliance requirements while providing features like remote device wipe, detailed access logs, and integration with LDAP/Active Directory for user management.

Key Features

  • Block-level file deduplication reduces storage requirements by up to 90% for organizations with similar documents
  • Client-side encryption with user-controlled keys ensures files remain encrypted even from system administrators
  • Git-like file versioning with complete revision history and ability to restore any previous version
  • MariaDB Aria storage engine provides crash-safe metadata storage with automatic recovery
  • Memcached integration eliminates database bottlenecks during high concurrent access scenarios
  • Two-way sync clients for desktop maintain offline access with conflict resolution
  • Library-based organization allows granular sharing permissions at folder level rather than entire accounts
  • WebDAV and RESTful API support enables integration with third-party applications and mobile workflows

Common Use Cases

  • 1Law firms requiring client-privileged document sharing with audit trails and remote wipe capabilities
  • 2Engineering teams collaborating on CAD files and technical drawings with version control and large file handling
  • 3Healthcare organizations needing HIPAA-compliant file sharing with patient data encryption and access logging
  • 4Educational institutions providing secure file storage for faculty and students with departmental isolation
  • 5Remote development teams synchronizing code repositories and documentation across multiple time zones
  • 6Financial services firms sharing sensitive documents with clients while maintaining regulatory compliance
  • 7Manufacturing companies distributing technical specifications and quality documents to global facilities

Prerequisites

  • Minimum 2GB RAM for MariaDB metadata storage and Seafile processing (4GB+ recommended for 50+ users)
  • Port 80 and 443 available for Seafile web interface and client synchronization
  • Valid SSL certificate or domain name for secure client connections and mobile app access
  • Understanding of Seafile library concepts and permission models for proper organization setup
  • Basic knowledge of MariaDB backup procedures for protecting user data and sharing configurations
  • SMTP server configuration for user invitation emails and password reset functionality

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 seafile:
3 image: seafileltd/seafile-mc:latest
4 environment:
5 DB_HOST: mariadb
6 DB_ROOT_PASSWD: ${MYSQL_ROOT_PASSWORD}
7 SEAFILE_ADMIN_EMAIL: ${ADMIN_EMAIL}
8 SEAFILE_ADMIN_PASSWORD: ${ADMIN_PASSWORD}
9 SEAFILE_SERVER_LETSENCRYPT: "false"
10 SEAFILE_SERVER_HOSTNAME: ${SERVER_HOSTNAME}
11 ports:
12 - "80:80"
13 - "443:443"
14 volumes:
15 - seafile_data:/shared
16 depends_on:
17 - mariadb
18 - memcached
19 networks:
20 - seafile-net
21 restart: unless-stopped
22
23 mariadb:
24 image: mariadb:10.11
25 environment:
26 MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
27 volumes:
28 - mariadb_data:/var/lib/mysql
29 networks:
30 - seafile-net
31 restart: unless-stopped
32
33 memcached:
34 image: memcached:alpine
35 networks:
36 - seafile-net
37 restart: unless-stopped
38
39volumes:
40 seafile_data:
41 mariadb_data:
42
43networks:
44 seafile-net:
45 driver: bridge

.env Template

.env
1# MariaDB
2MYSQL_ROOT_PASSWORD=secure_root_password
3
4# Seafile Admin
5ADMIN_EMAIL=admin@example.com
6ADMIN_PASSWORD=secure_admin_password
7
8# Server
9SERVER_HOSTNAME=seafile.example.com

Usage Notes

  1. 1Web UI at http://localhost
  2. 2Desktop and mobile clients available
  3. 3File versioning and encryption
  4. 4Team and group management

Individual Services(3 services)

Copy individual services to mix and match with your existing compose files.

seafile
seafile:
  image: seafileltd/seafile-mc:latest
  environment:
    DB_HOST: mariadb
    DB_ROOT_PASSWD: ${MYSQL_ROOT_PASSWORD}
    SEAFILE_ADMIN_EMAIL: ${ADMIN_EMAIL}
    SEAFILE_ADMIN_PASSWORD: ${ADMIN_PASSWORD}
    SEAFILE_SERVER_LETSENCRYPT: "false"
    SEAFILE_SERVER_HOSTNAME: ${SERVER_HOSTNAME}
  ports:
    - "80:80"
    - "443:443"
  volumes:
    - seafile_data:/shared
  depends_on:
    - mariadb
    - memcached
  networks:
    - seafile-net
  restart: unless-stopped
mariadb
mariadb:
  image: mariadb:10.11
  environment:
    MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
  volumes:
    - mariadb_data:/var/lib/mysql
  networks:
    - seafile-net
  restart: unless-stopped
memcached
memcached:
  image: memcached:alpine
  networks:
    - seafile-net
  restart: unless-stopped

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 seafile:
5 image: seafileltd/seafile-mc:latest
6 environment:
7 DB_HOST: mariadb
8 DB_ROOT_PASSWD: ${MYSQL_ROOT_PASSWORD}
9 SEAFILE_ADMIN_EMAIL: ${ADMIN_EMAIL}
10 SEAFILE_ADMIN_PASSWORD: ${ADMIN_PASSWORD}
11 SEAFILE_SERVER_LETSENCRYPT: "false"
12 SEAFILE_SERVER_HOSTNAME: ${SERVER_HOSTNAME}
13 ports:
14 - "80:80"
15 - "443:443"
16 volumes:
17 - seafile_data:/shared
18 depends_on:
19 - mariadb
20 - memcached
21 networks:
22 - seafile-net
23 restart: unless-stopped
24
25 mariadb:
26 image: mariadb:10.11
27 environment:
28 MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
29 volumes:
30 - mariadb_data:/var/lib/mysql
31 networks:
32 - seafile-net
33 restart: unless-stopped
34
35 memcached:
36 image: memcached:alpine
37 networks:
38 - seafile-net
39 restart: unless-stopped
40
41volumes:
42 seafile_data:
43 mariadb_data:
44
45networks:
46 seafile-net:
47 driver: bridge
48EOF
49
50# 2. Create the .env file
51cat > .env << 'EOF'
52# MariaDB
53MYSQL_ROOT_PASSWORD=secure_root_password
54
55# Seafile Admin
56ADMIN_EMAIL=admin@example.com
57ADMIN_PASSWORD=secure_admin_password
58
59# Server
60SERVER_HOSTNAME=seafile.example.com
61EOF
62
63# 3. Start the services
64docker compose up -d
65
66# 4. View logs
67docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/seafile-cloud-storage/run | bash

Troubleshooting

  • Seafile service fails to start with database connection error: Verify MYSQL_ROOT_PASSWORD environment variable matches between mariadb and seafile services
  • Desktop clients cannot sync with 'SSL certificate verify failed': Ensure SEAFILE_SERVER_HOSTNAME matches your actual domain name and SSL certificate
  • File uploads fail with 'Request Entity Too Large': Modify Seafile's seahub_settings.py to increase FILE_UPLOAD_MAX_MEMORY_SIZE beyond default 200MB
  • Slow performance during peak usage: Monitor memcached hit rates and increase memcached memory allocation or add additional memcached instances
  • Users cannot access shared libraries: Check Seafile database ccnet-db for proper group memberships and sharing permissions in the EmailUser and Group tables
  • MariaDB crashes during large file operations: Increase innodb_buffer_pool_size to at least 1GB and set innodb_log_file_size to 256MB for better transaction handling

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space