docker.recipes

Seafile File Sync and Share

intermediate

Enterprise file sync with Seafile, office editor, and backup.

Overview

Seafile is an open-source file hosting and synchronization platform that provides enterprise-grade file sharing capabilities similar to Dropbox or Google Drive, but with full control over your data. Originally developed by a team in China and first released in 2012, Seafile has evolved into a robust solution that combines file synchronization, sharing, and collaboration features with strong security and version control capabilities. Unlike simple file storage solutions, Seafile organizes files into libraries (encrypted repositories) and provides features like file locking, detailed audit logs, and client-side encryption. This stack combines Seafile's core server with MariaDB for robust data persistence, Memcached for high-performance caching, and OnlyOffice Document Server for real-time collaborative editing of office documents. MariaDB serves as the primary database engine storing user accounts, file metadata, and sharing permissions, while Memcached accelerates file operations and reduces database load during high-traffic scenarios. The integration with OnlyOffice enables users to edit Word documents, Excel spreadsheets, and PowerPoint presentations directly within the Seafile web interface without downloading files locally. This configuration targets organizations seeking a self-hosted alternative to commercial cloud storage services while maintaining professional document editing capabilities. Small to medium businesses, educational institutions, and teams handling sensitive documents will benefit from this setup's combination of data sovereignty, collaborative editing, and enterprise-level file management features. The stack provides both web access and desktop synchronization clients across Windows, macOS, and Linux platforms.

Key Features

  • Library-based file organization with client-side encryption for secure data storage
  • Real-time collaborative document editing through OnlyOffice integration for Word, Excel, and PowerPoint files
  • Desktop synchronization clients for Windows, macOS, and Linux with selective sync capabilities
  • File versioning and history tracking with rollback capabilities for accidental changes
  • Advanced sharing controls including password protection, expiration dates, and permission levels
  • MariaDB backend providing ACID compliance and Galera clustering support for high availability
  • Memcached integration for accelerated file metadata queries and improved web interface performance
  • Mobile applications for iOS and Android with offline file access and automatic photo backup

Common Use Cases

  • 1Small business teams requiring secure file sharing with collaborative document editing capabilities
  • 2Educational institutions managing student projects and faculty documents with version control
  • 3Remote development teams synchronizing code documentation and project files across multiple locations
  • 4Healthcare organizations storing patient documents with audit trails and access controls
  • 5Legal firms managing case files with granular sharing permissions and document versioning
  • 6Creative agencies collaborating on marketing materials and client presentations in real-time
  • 7Non-profit organizations maintaining donor records and grant documents with secure sharing

Prerequisites

  • Minimum 2GB RAM recommended (1GB+ for MariaDB, 512MB for Seafile, additional overhead for OnlyOffice)
  • Available ports 80 and 8080 for web interfaces, with port 80 accessible from client networks
  • Valid email server configuration for user registration and notification features
  • SSL certificate for production deployment to enable desktop client synchronization
  • Basic understanding of database management for MariaDB maintenance and backup procedures
  • Domain name or static IP address for consistent client access and OnlyOffice integration

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 mariadb:
3 image: mariadb:10.11
4 environment:
5 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
6 - MYSQL_LOG_CONSOLE=true
7 volumes:
8 - mariadb_data:/var/lib/mysql
9 networks:
10 - seafile_net
11
12 memcached:
13 image: memcached:alpine
14 networks:
15 - seafile_net
16
17 seafile:
18 image: seafileltd/seafile-mc:latest
19 ports:
20 - "80:80"
21 environment:
22 - DB_HOST=mariadb
23 - DB_ROOT_PASSWD=${MYSQL_ROOT_PASSWORD}
24 - SEAFILE_ADMIN_EMAIL=${ADMIN_EMAIL}
25 - SEAFILE_ADMIN_PASSWORD=${ADMIN_PASSWORD}
26 - SEAFILE_SERVER_HOSTNAME=localhost
27 volumes:
28 - seafile_data:/shared
29 depends_on:
30 - mariadb
31 - memcached
32 networks:
33 - seafile_net
34
35 onlyoffice:
36 image: onlyoffice/documentserver:latest
37 ports:
38 - "8080:80"
39 environment:
40 - JWT_SECRET=${ONLYOFFICE_SECRET}
41 volumes:
42 - onlyoffice_data:/var/www/onlyoffice/Data
43 networks:
44 - seafile_net
45
46volumes:
47 mariadb_data:
48 seafile_data:
49 onlyoffice_data:
50
51networks:
52 seafile_net:

.env Template

.env
1# Seafile
2MYSQL_ROOT_PASSWORD=secure_mysql_root_password
3ADMIN_EMAIL=admin@example.com
4ADMIN_PASSWORD=secure_admin_password
5ONLYOFFICE_SECRET=secure_jwt_secret
6
7# Seafile at http://localhost
8# OnlyOffice at http://localhost:8080

Usage Notes

  1. 1Seafile at http://localhost
  2. 2OnlyOffice at http://localhost:8080
  3. 3Desktop sync clients available
  4. 4Library-based organization
  5. 5Configure OnlyOffice in admin panel

Individual Services(4 services)

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

mariadb
mariadb:
  image: mariadb:10.11
  environment:
    - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
    - MYSQL_LOG_CONSOLE=true
  volumes:
    - mariadb_data:/var/lib/mysql
  networks:
    - seafile_net
memcached
memcached:
  image: memcached:alpine
  networks:
    - seafile_net
seafile
seafile:
  image: seafileltd/seafile-mc:latest
  ports:
    - "80:80"
  environment:
    - DB_HOST=mariadb
    - DB_ROOT_PASSWD=${MYSQL_ROOT_PASSWORD}
    - SEAFILE_ADMIN_EMAIL=${ADMIN_EMAIL}
    - SEAFILE_ADMIN_PASSWORD=${ADMIN_PASSWORD}
    - SEAFILE_SERVER_HOSTNAME=localhost
  volumes:
    - seafile_data:/shared
  depends_on:
    - mariadb
    - memcached
  networks:
    - seafile_net
onlyoffice
onlyoffice:
  image: onlyoffice/documentserver:latest
  ports:
    - "8080:80"
  environment:
    - JWT_SECRET=${ONLYOFFICE_SECRET}
  volumes:
    - onlyoffice_data:/var/www/onlyoffice/Data
  networks:
    - seafile_net

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 mariadb:
5 image: mariadb:10.11
6 environment:
7 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
8 - MYSQL_LOG_CONSOLE=true
9 volumes:
10 - mariadb_data:/var/lib/mysql
11 networks:
12 - seafile_net
13
14 memcached:
15 image: memcached:alpine
16 networks:
17 - seafile_net
18
19 seafile:
20 image: seafileltd/seafile-mc:latest
21 ports:
22 - "80:80"
23 environment:
24 - DB_HOST=mariadb
25 - DB_ROOT_PASSWD=${MYSQL_ROOT_PASSWORD}
26 - SEAFILE_ADMIN_EMAIL=${ADMIN_EMAIL}
27 - SEAFILE_ADMIN_PASSWORD=${ADMIN_PASSWORD}
28 - SEAFILE_SERVER_HOSTNAME=localhost
29 volumes:
30 - seafile_data:/shared
31 depends_on:
32 - mariadb
33 - memcached
34 networks:
35 - seafile_net
36
37 onlyoffice:
38 image: onlyoffice/documentserver:latest
39 ports:
40 - "8080:80"
41 environment:
42 - JWT_SECRET=${ONLYOFFICE_SECRET}
43 volumes:
44 - onlyoffice_data:/var/www/onlyoffice/Data
45 networks:
46 - seafile_net
47
48volumes:
49 mariadb_data:
50 seafile_data:
51 onlyoffice_data:
52
53networks:
54 seafile_net:
55EOF
56
57# 2. Create the .env file
58cat > .env << 'EOF'
59# Seafile
60MYSQL_ROOT_PASSWORD=secure_mysql_root_password
61ADMIN_EMAIL=admin@example.com
62ADMIN_PASSWORD=secure_admin_password
63ONLYOFFICE_SECRET=secure_jwt_secret
64
65# Seafile at http://localhost
66# OnlyOffice at http://localhost:8080
67EOF
68
69# 3. Start the services
70docker compose up -d
71
72# 4. View logs
73docker 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-complete/run | bash

Troubleshooting

  • OnlyOffice documents fail to open: Verify JWT_SECRET environment variable matches between Seafile admin settings and OnlyOffice container configuration
  • Desktop clients cannot connect: Ensure SEAFILE_SERVER_HOSTNAME matches the actual domain/IP used by clients and SSL is properly configured for production
  • Database connection errors on startup: Check that MariaDB container is fully initialized before Seafile attempts connection, increase depends_on wait time if necessary
  • Slow file uploads or timeouts: Increase Memcached memory allocation and verify MariaDB has sufficient RAM allocated for file metadata operations
  • User registration emails not sent: Configure SMTP settings in Seafile admin panel and verify firewall allows outbound email traffic
  • OnlyOffice collaborative editing not working: Ensure both Seafile and OnlyOffice containers can communicate over the seafile_net network and JWT secrets match

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