• Stars
    star
    520
  • Rank 85,117 (Top 2 %)
  • Language
    Python
  • License
    Other
  • Created over 9 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Docker image for Seafile server

Build Status

About

  • Docker is an open source project to pack, ship and run any Linux application in a lighter weight, faster container than a traditional virtual machine.

  • Docker makes it much easier to deploy a Seafile server on your servers and keep it updated.

  • The base image configures Seafile with the Seafile team's recommended optimal defaults.

If you are not familiar with docker commands, please refer to docker documentation.

For seafile 7.x.x

Starting with 7.0, we have adjusted seafile-docker image to use multiple containers. The old image runs MariaDB-Server and Memcached in the same container with Seafile server. Now, we strip the MariaDB-Server and Memcached services from the Seafile image and run them in their respective containers.

If you plan to deploy seafile 7.0, you should refer to the Deploy Documentation.

If you plan to upgrade 6.3 to 7.0, you can refer to the Upgrade Documentation.

For seafile 6.x.x

Getting Started

To run the seafile server container:

docker run -d --name seafile \
  -e SEAFILE_SERVER_HOSTNAME=seafile.example.com \
  -v /opt/seafile-data:/shared \
  -p 80:80 \
  seafileltd/seafile:latest

Wait for a few minutes for the first time initialization, then visit http://seafile.example.com to open Seafile Web UI.

This command will mount folder /opt/seafile-data at the local server to the docker instance. You can find logs and other data under this folder.

More configuration Options

Custom Admin Username and Password

The default admin account is [email protected] and the password is asecret. You can use a different password by setting the container's environment variables: e.g.

docker run -d --name seafile \
  -e SEAFILE_SERVER_HOSTNAME=seafile.example.com \
  -e [email protected] \
  -e SEAFILE_ADMIN_PASSWORD=a_very_secret_password \
  -v /opt/seafile-data:/shared \
  -p 80:80 \
  seafileltd/seafile:latest

If you forget the admin password, you can add a new admin account and then go to the sysadmin panel to reset user password.

Let's encrypt SSL certificate

If you set SEAFILE_SERVER_LETSENCRYPT to true, the container would request a letsencrypt-signed SSL certificate for you automatically.

e.g.

docker run -d --name seafile \
  -e SEAFILE_SERVER_LETSENCRYPT=true \
  -e SEAFILE_SERVER_HOSTNAME=seafile.example.com \
  -e [email protected] \
  -e SEAFILE_ADMIN_PASSWORD=a_very_secret_password \
  -v /opt/seafile-data:/shared \
  -p 80:80 \
  -p 443:443 \
  seafileltd/seafile:latest

If you want to use your own SSL certificate:

  • create a folder /opt/seafile-data/ssl, and put your certificate and private key under the ssl directory.
  • Assume your site name is seafile.example.com, then your certificate must have the name seafile.example.com.crt, and the private key must have the name seafile.example.com.key.

Modify Seafile Server Configurations

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

After modification, you need to restart the container:

docker restart seafile

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.

Add a new Admin

Ensure the container is running, then enter this command:

docker exec -it seafile /opt/seafile/seafile-server-latest/reset-admin.sh

Enter the username and password according to the prompts. You now have a new admin account.

Directory Structure

/shared

Placeholder spot for shared volumes. You may elect to store certain persistent information outside of a container, in our case we keep various logfiles and upload directory outside. This allows you to rebuild containers easily without losing important information.

  • /shared/db: This is the data directory for mysql server
  • /shared/seafile: This is the directory for seafile server configuration and data.
  • /shared/logs: This is the directory for logs.
    • /shared/logs/var-log: This is the directory that would be mounted as /var/log inside the container. For example, you can find the nginx logs in shared/logs/var-log/nginx/.
    • /shared/logs/seafile: This is the directory that would contain the log files of seafile server processes. For example, you can find seaf-server logs in shared/logs/seafile/seafile.log.
  • /shared/ssl: This is directory for certificate, which does not exist by default.

Upgrading Seafile Server

TO upgrade to latest version of seafile server:

docker pull seafileltd/seafile:latest
docker rm -f seafile
docker run -d --name seafile \
  -e SEAFILE_SERVER_LETSENCRYPT=true \
  -e SEAFILE_SERVER_HOSTNAME=seafile.example.com \
  -e [email protected] \
  -e SEAFILE_ADMIN_PASSWORD=a_very_secret_password \
  -v /opt/seafile-data:/shared \
  -p 80:80 \
  -p 443:443 \
  seafileltd/seafile:latest

If you are one of the early users who use the launcher script, you should refer to upgrade from old format document.

Garbage Collection

When files are deleted, the blocks comprising those files are not immediately removed as there may be other files that reference those blocks (due to the magic of deduplication). To remove them, Seafile requires a garbage collection process to be run, which detects blocks that are no longer used and purges them. (NOTE: for technical reasons, the GC process does not guarantee that every single orphaned block will be deleted.)

The required scripts can be found in the /scripts folder of the docker container. To perform garbage collection, simply run docker exec seafile /scripts/gc.sh. For the community edition, this process will stop the seafile server, but it is a relatively quick process and the seafile server will start automatically once the process has finished. The Professional supports an online garbage collection.

Troubleshooting

You can run docker commands like "docker logs" or "docker exec" to find errors.

docker logs -f seafile
# or
docker exec -it seafile bash

More Repositories

1

seafile

High performance file syncing and sharing, with also Markdown WYSIWYG editing, Wiki, file label and other knowledge management features.
C
11,597
star
2

seafile-rpi

Seafile server package for Raspberry Pi.
Shell
552
star
3

seahub

The web end of seafile server.
Python
511
star
4

seadroid

Android client for Seafile
Java
504
star
5

seafile-client

Seafile desktop client.
C++
448
star
6

seafile-server

Seafile Server Core
C
424
star
7

seafile-server-installer-cn

One script to install seafile server
Shell
363
star
8

seafile-docs-cn

SeafileๆœๅŠกๅ™จ็”จๆˆทๆ‰‹ๅ†Œ
Shell
293
star
9

seafile-iOS

iOS client for seafile
Objective-C
210
star
10

seafdav

Seafile webdav server
Python
81
star
11

seadrive-gui

GUI part of seadrive.
C++
58
star
12

seafile-user-manual

Manual for Seafile client
CSS
58
star
13

libsearpc

A simple C language RPC framework (including both server side & client side). Python binding is also provided
C
56
star
14

python-seafile

python client for seafile web api
Python
29
star
15

seafile-admin-docs

Shell
25
star
16

webapi-examples

seafile web api examples
C#
20
star
17

ccnet-server

Internal communication framework and user/group management for Seafile server
C
17
star
18

seafile-js

Seafile Javascript API
JavaScript
17
star
19

seadrive-fuse

SeaDrive daemon with FUSE interface
C
17
star
20

seafobj

python library for accessing seafile data model
Python
16
star
21

seafile-shell-ext

Windows Shell Extension for Seafile Client
C++
11
star
22

seafile-vagrant

vagrant configuration for seafile development.
Shell
9
star
23

NewQuickAction

QuickAction for android
Java
8
star
24

maven-repo

maven libraries used by seafle android app
5
star
25

seafile-outlook

Seafile Outlook plugin
C#
5
star
26

seafile-docs-ko

Manual for Seafile server (Korean)
3
star
27

seafile-zimlet

JavaScript
3
star
28

seafile-python-api-examples

seafile apython api examples
Shell
2
star
29

seafile-test-deploy

Scripts for setup the seafile test enviroment.
Shell
2
star
30

seafile-release-tools

Python
2
star
31

seafile-ansible

1
star
32

seafile-server-manual

1
star
33

docker-example-ali

Python
1
star
34

sea-markdown-editor

A WYSIWYG Markdown editor
JavaScript
1
star