This guide uses Docker Compose to run Seafile in containers with MariaDB database and Memcached caching.
For Docker installation, see Docker.
Create a docker-compose.yml file with the following content:
version: '3.8'
services:
db:
image: mariadb:10.11
container_name: seafile-mysql
environment:
- MYSQL_ROOT_PASSWORD=db_root_pass
- MYSQL_LOG_CONSOLE=true
volumes:
- ./db-data:/var/lib/mysql
networks:
- seafile-net
memcached:
image: memcached:1.6.29
container_name: seafile-memcached
entrypoint: memcached -m 256
networks:
- seafile-net
seafile:
image: seafileltd/seafile-mc:13.0-latest
container_name: seafile
ports:
- "80:80"
- "443:443"
volumes:
- ./seafile-data:/shared
environment:
- DB_HOST=db
- DB_ROOT_PASS=db_root_pass
- SEAFILE_ADMIN_EMAIL=admin@example.com
- SEAFILE_ADMIN_PASSWORD=your-admin-password
- SEAFILE_SERVER_HOSTNAME=seafile.example.com
- JWT_PRIVATE_KEY=your-32-char-random-secret-key
depends_on:
- db
- memcached
networks:
- seafile-net
networks:
seafile-net:
driver: bridge
Security Note: Replace the following before deployment:
db_root_pass - Strong database root passwordadmin@example.com - Your admin emailyour-admin-password - Strong admin passwordseafile.example.com - Your server hostnameyour-32-char-random-secret-key - Generate with: openssl rand -hex 32docker compose up -d
Wait for the containers to start (approximately 2-3 minutes for first-run setup).
Open https://YOUR-SERVER and log in with:
SEAFILE_ADMIN_EMAILSEAFILE_ADMIN_PASSWORDFor production deployments:
SEAFILE_SERVER_HOSTNAME./seafile-data and ./db-data directoriesAdd these environment variables for SMTP:
environment:
- SEAFILE_ADMIN_EMAIL=admin@example.com
- SEAFILE_SERVER_HOSTNAME=seafile.example.com
- EMAIL_HOST=smtp.example.com
- EMAIL_PORT=587
- EMAIL_HOST_USER=smtp-user
- EMAIL_HOST_PASSWORD=smtp-password
- EMAIL_USE_TLS=true
See Configuration and Security for production hardening.
Any questions?
Feel free to contact us. Find all contact information on our contact page.