🌐 VI | EN

Run Seafile in Docker

Nghia Phan
Nghia Phan
🌐 Bản tiếng Việt → Technical Guide Views
Advertisement
Sponsored

Seafile is an open-source file synchronization and sharing platform. This guide runs MariaDB and Seafile on one Docker network and stores their data under ~/docker/mariadb and ~/docker/seafile.

Install Docker

Log into Linux with sudo access and run:

sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -ycurl -fsSL https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)/gpg | sudo apt-key add -sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release) $(lsb_release -cs) stable"sudo apt install docker-ce docker-compose containerd.io -ysudo systemctl enable docker && sudo systemctl start dockersudo usermod -aG docker $USERsu - $USER

For a current distribution, also see the Docker documentation because apt-key is deprecated.

Run MariaDB and Seafile

  1. Create the directories and network:
mkdir ~/docker/mariadb -p && mkdir ~/docker/seafilesudo chown "$USER":"$USER" ~/docker -Rdocker network create containers
  1. Start MariaDB. Replace [DB_ROOT_PASSWORD] with a private secret:
docker run -d --name mariadb --network containers \  -e MYSQL_ROOT_PASSWORD='[DB_ROOT_PASSWORD]' \  -v ~/docker/mariadb:/var/lib/mysql \  --restart=unless-stopped mariadb:latest
  1. Start Seafile and point it to the mariadb container:
docker run -d --name seafile --network containers -p 8080:80 \  -e DB_HOST=mariadb \  -e DB_ROOT_PASSWD='[DB_ROOT_PASSWORD]' \  -e TIME_ZONE=Asia/Ho_Chi_Minh \  -v ~/docker/seafile:/shared \  --restart=unless-stopped seafileltd/seafile-mc:11.0-latest

Configure Seafile

  1. Open http://DNSorIP:8080 and wait for first initialization.
  2. Sign in with the administrator account created by the image or your configured credentials; do not use the source’s sample credentials.
  3. Click the profile icon > System Admin > Users.
  4. Click Add User, enter a private email and password, then Submit.
  5. Open Admin, click Add Admin, select the new user, and Submit.
  6. Log out, sign in as the new user, and return to System Admin > Users.
  7. Select the sample me@example.com user if it exists and click Delete Users.
  8. Test upload, download, library creation, and sharing permissions.

Warning: Back up both ~/docker/seafile and the database before upgrading the image. Do not expose MariaDB to the Internet; place Seafile behind an HTTPS reverse proxy outside the LAN.

Quảng cáo

Sources and video

Sponsored Advertisement
Partnership

Comments & Discussion

Share your thoughts, ask questions and feedback

Markdown & QQ Emoji
Loading comments...