How to migrate Seafile CE with Apache to Docker

I have some questions concerning the manual Migrate from non-docker Seafile deployment to docker.

  1. Who should be the owner of the working folder /opt/seafile-data?
  2. Do I have to create the docker container as root or as user seafile?

When I try to connect the server I get the following error: “502 Bad Gatway / nginx”.
I guess my problem is, that my Seafile CE server uses Apache.

  1. Is there also a migration manual for Seafile with Apache?
  2. Do I need to migrate from Apache to Nginx before I migrate to docker?

The log file shows the following error: “waiting for mysql server to be ready: %s (2003, “Can’t connect to MySQL server on ‘’ ([Errno 111] Connection refused)”)”

  1. Could this be because the user does not have mysql grants?
  2. How do I find out which user is causing the error message?

Hi Thomas,

  1. The owner of the seafile folder will more than likely be the user called ‘Seafile’

  2. You will need to allow docker to be run without SUDO being used for the Seafile User. (I can see if I can find the documentation if that is preferred?). I have a docker container setup on my REPO setup, so that I can run LibreOffice Online (and soon to be ElasticSearch) on the same machine :slight_smile:.

Do you have more than 3 users? If not, then I would highly recommend the Pro version (a lot more feature filled). Even if you do, it’s only $99 annually for up to 9 users (<$0.92 per month).

3/4. If you would like to use Apache, this may be a good blog to read into, as to my knowledge it will use Nginx by default:

  1. This will most likely need to be done by the user that owns the MySQL Database itself, this may well be the Seafile user if you used the Github script to do the setup.

  2. I believe there is details within the Docker-compose.yml which contain the MySQL login details, have you played with Docker before or are you looking to migrate to it? (If so, is this because of issues or preference?)

Any issues, please let me know!

Kind regards,

Hi Mitch,

To 1./2.: I’ve managed to create the container as user seafile (see docker manual).

To 3./4.: The blog is helpful. The container references the image seafileltd/seafile:latest (instead of seafileltd/seafile-mc:latest). But the image seems not to support the RPI4 and ends with the following error:

! seafile The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 0.0s

Is there a way to request a specific platform?

I use seafile at home with only 2 users.

BR Thomas

Due to it only being two users, I would highly recommend swapping over to the pro version!

Reference error, are you sure you downloaded the correct Seafile docker? I only mention this because it was to my knowledge that Seafile had an ARM based setup as well separate to the AMD64 version.

Seafile pro edition 10.0.9 is ready! ARM64 is also supported now (This is a good few versions old now but relevant).

Are you downloading the docker-compose.yml file through the docker command, or are you downloading the file? (I would see if you could specify ARM64 if you are pulling it through docker).

Let me know if you need help with the commands to do a straight docker download and setup!

Kind regards,

Ignore the previous response regarding the mention of the docker commands!

This guide looks pretty useful with setting up a docker-based setup on a raspberry pi, have a look at this and let me know if you have any questions - I would be happy to assist!

If you need any further assistance but need a quicker response, please email me on

I can’t solve the problem. I will use Nginx as reverse proxy.