Installing docker

See Docker install

Setup Seafile with docker

2mkdir docker-compose/seafile; cd seafile
3mkdir mysql-data
4mkdir seafile-data
5touch .env
6touch dot-env-template


  • docker-compose file spools up three containers: mariadb, memcached, seafile.
  • These communicate via their internal network seafile-net
  • additionally, the network seafile-npm is created to enable seafile talk to Nginx Proxy Manager. The npm docker container will be added to this network in npm’s docker-compose file.
  • Since npm and seafile will be on the same seafile_seafile-npm network, npm can directly access seafile:80. So there is no need to expose seafile’s ports to the host. Therefore, the port mapping parts of the docker-compose file below are commented out.
  • The docker-compose file pulls in info from various environment variables. We create a dot-env-template file and a .env file. Both are similar, but the .env file has the actual content whereas the dot-env-template file does not have the sensitive content and can be backed up or committed to a git repository. The .env file will be in .gitignore because it contains sensitive content that is not needed to recreate the docker setup and should not be exposed inadvertently.
  • We don’t use any of seafile’s https features because we manage https termination at/with nginx proxy manager. See subsection on this below. But also see below that we do set the SERVICE_URL to https in the post-install configuration.


 1version: '2.0'
 3  db:
 4    image: mariadb:10.5
 5    container_name: seafile-mysql
 6    environment:
 7      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}  # Requested, set the root's password of MySQL service.
 8      - MYSQL_LOG_CONSOLE=true
 9    volumes:
10      - ./mysql-data:/var/lib/mysql  # Requested, specifies the path to MySQL data persistent store.
11    networks:
12      - seafile-net
14  memcached:
15    image: memcached:1.5.6
16    container_name: seafile-memcached
17    entrypoint: memcached -m 256
18    networks:
19      - seafile-net
21  seafile:
22    image: seafileltd/seafile-mc:9.0.1
23    container_name: seafile
24#    ports:
25#      - ""
26#     - "443:443"  # If https is enabled, cancel the comment.
27    volumes:
28      - ./seafile-data:/shared   # Requested, specifies the path to Seafile data persistent store.
29    environment:
30      - DB_HOST=db
31      - DB_ROOT_PASSWD=${MYSQL_ROOT_PASSWORD}  # Requested, the value shuold be root's password of MySQL service.
32      - TIME_ZONE=America/Los_Angeles  # Optional, default is UTC. Should be uncomment and set to your local time zone.
33      - SEAFILE_ADMIN_EMAIL=${SEAFILE_ADMIN_EMAIL} # Specifies Seafile admin user, default is ''.
34      - SEAFILE_ADMIN_PASSWORD=${SEAFILE_ADMIN_PASSWORD}     # Specifies Seafile admin password, default is 'asecret'.
35      - SEAFILE_SERVER_LETSENCRYPT=false   # Whether to use https or not.
36      - SEAFILE_SERVER_HOSTNAME=${SEAFILE_SERVER_HOSTNAME} # Specifies your host name if https is enabled.
37    depends_on:
38      - db
39      - memcached
40    networks:
41      - seafile-net
42      - seafile-npm
44  seafile-net:
45  seafile-npm:

Note: Initially, the dockerfile was pulling in env variables with formatting SEAFILE_SERVER_HOSTNAME="${SEAFILE_SERVER_HOSTNAME}" because that is what I read on some blog post. However, the " " were possibly causing issues. seahub would fail to start (as noted by output of the command docker logs -f seafile). Poking around, I noticed that the file had some weird " characters in the SERVICE_URL (or something similar to that) key value. I removed the “”, and seahub’s issues magically went away /shrug.

.env file

Create a .env file and a dot-env-template file with the content


Note that there is no space after the = when you add the values in the .env. file. Leave the dot-env-template file empty though.

TIP: In a pinch, can generate random passwords with

1head /dev/urandom | tr -dc A-Za-z0-9 | head -c16

NPM and SSL / https configuration

Configure reverse proxy to seafile:80 as a new proxy host in NPM. Force SSL.

Seafile actually does not know that it is running behind https. We are not using any https functionality in seafile. Rather, nginx proxy manager will be the termination point for It’ll reverse proxy this https traffic to seafile:80 internally, without https.

Modify Seafile server configurations

The config files are under shared/seafile/conf. You can modify the configurations, if needed, according to Seafile manual

1docker exec -it seafile /bin/bash

After modification, you need to restart the container:

1docker-compose restart


If you need a shell inside the docker container, use the command

1docker exec -it seafile /bin/bash

Find logs

The Seafile logs are under shared/logs/seafile in the docker, or /opt/seafile-data/logs/seafile in the server that run the docker.

The system logs are under shared/logs/var-log, or /opt/seafile-data/logs/var-log in the server that run the docker.

Post install

  • Log in to seafile using the admin username/pw set in the .env file.

  • In sys admin settings configure


    Without this, the clients may not work properly (I have not tested this)

  • Change SITE_TITLE and SITE_NAME as needed (Seafile and Sagar’s Seafile)


  • enable two factor authentication in admin settings

  • Enable 2FA in user settings

  • Set Avtar (photo) in user settings

  • Change password is user settings. NOTE: I think that changing the user password through the user settings essentially supercedes the admin password environment variable in the .env file i.e. that env variable password is not valid any more.

  • Switch to golang file server. sudo editor seafile-data/seafile/conf/seafile.conf and add the line

    2use_go_fileserver = true

    then docker-compose restart. HOWEVER, I have no clue whether this fileserver is actually being used. No mention of it in docker logs -f seafile.


See Seafile’s docker deployment manual. Note that rather than using the latest tag, we explicitly specify the actual version in our docker-compose.yaml file. So, for example, when upgrading from Seafile-server-9.0.9 to seafile-server-9.0.10 you should

1. Edit the docker-compose.yaml file and replace imag``e: seafileltd/seafile-mc:9.0.9 with image: seafileltd/seafile-mc:9.0.10

2. docker-compose down

3. docker-compose up -d


  1. <– Seafile docker installation manual


  1. Configure Seafile to send email
  2. Enable some go related settings in v9.0.1 which are off by default
  3. Figure out what to backup in the installation and how to do backup and recovery of the seafile application