Fast cloud storage for in-house hosting

With or Without Docker

I will be looking at the Docker variant on Ubuntu Server 20.04. Listing 1 shows the installation of Docker on this system. Then, using the commands in Listing 2, you install Docker Compose using docker-compose --version to check that the desired version is installed.

Listing 1

Installing Docker (Ubuntu 20.04)

$ sudo apt update
$ sudo apt install apt-transport-https ca-certificates curl software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
### For other releases replace "focal" with the respective code name
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
$ sudo apt update
$ sudo apt install docker-ce
$ sudo systemctl status docker
$ sudo usermod -aG docker ${USER}

Listing 2

Installing Docker Compose (Ubuntu 20.04)

### Replace version 2.6.0 with a newer release if applicable.
$ sudo curl -L "https://github.com/docker/compose/releases/download/v2.6.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
$ docker-compose --version

Whether you install Seafile on a Raspberry Pi, an old computer, or a server does not matter at first, provided you have downloaded the correct architecture for the hardware in question. ARM-based Docker files are available for the Rasp Pi [8]. You will want to install the server variant for Ubuntu or Debian. The system does not require a desktop environment, because you will be working with the web interface later on.

To install Seafile itself, download the docker-compose.yml [9] file off the web using the commands in Listing 3 and drop it into your home directory in the /home/seafile/ folder that you create up front.

Listing 3

Seafile via Docker Compose

$ sudo mkdir /home/seafile
$ cd /home/seafile
$ sudo wget -O docker-compose.yml https://download.seafile.com/d/320e8adf90fa43ad8fee/files/?p=/docker/docker-compose.yml

Then open the file in an editor and adjust the configuration to meet your needs. To do this, assign passwords for the MYSQL_ROOT_PASSWORD, DB_ROOT_PASSWD, and SEAFILE_ADMIN_PASSWORD lines. If necessary, adjust the two paths under volumes if you prefer a different location in the filesystem tree. Store an email address in SEAFILE_ADMIN_EMAIL. You will need this to log in later on.

If you want the server to be accessible and encrypted on the road, you also need to set SEAFILE_SERVER_LETSENCRYPT to true. Then enter a registered domain name for SEAFILE_SERVER_HOSTNAME. If you do not have a registered domain, you can use a service such as DynDNS. For an initial try-out, you will want to call the Seafile installation without SSL (i.e., without https:// in the URL) to eliminate possible sources of error.

In the Browser

Then, working in the /home/seafile/ directory, run:

sudo docker-compose up -d

This downloads the required images and dumps them into the appropriate containers. This will take a few minutes. Once the prompt reappears (Figure 1), log in to the web interface from any computer on your network. The URL is composed of the IP address of the server and the corresponding port.

Figure 1: After Docker Compose has set up the three containers, an instruction panel explains your next options.

Depending on the installation method, this can be http://IP:80, IP:8000, or, if you have integrated a certificate for SSL transmission, https:// IP:443. If you do not have a static IP address for the server and your router allows this, you should always assign the same IPv4 address to the server.

Clearly Structured

Seafile's interface is clear-cut and well laid out; all the options are immediately understandable (Figure 2). From the left panel, you can access libraries, groups, connected devices, and share management (Figure 3). You can use the avatar icon top right to access your profile and system administration. This where you create additional users, groups, and libraries. You can then share them or assign them to another user.

Figure 2: The clearly structured Seafile web interface gives you access to the full feature set via the sidebar. The context menu shows the options for individual files.
Figure 3: Among other things, System Administration provides an overview of devices currently connected to the server. It is also used to create additional users and groups.

To check if the network connection to the server is working, manually upload a file as a test. To do this, use the Upload button, which you will find on the left side of the top bar in every library. Alternatively, drag the files into the open library.

If a network error occurs during the upload (and this is probably more of a Docker issue than a Seafile one), go to the Settings subitem in System Administration and take a closer look at the first two lines, SERVICE_URL and FILE_SERVER_ROOT. Do they contain your IP address and, if applicable, the port? If not, add the IP that you used to launch the web interface here. You need to keep the /seafhttp bit.

After changing the first line, check the box at the end. Do the same thing for line 2. After pressing F5 to refresh the page content, you should now be able to upload files.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • simpleDrive

    If you value data security and privacy, you might want to build your own cloud storage. SimpleDrive offers a workable alternative to this time-consuming project.

  • Comparing Cloud Providers

    Many companies now offer data storage in the cloud. We tested seven alternatives with a close look at security features.

  • Docker Open Source Developer Tools

    Docker provides the open source tools and resources for compiling, building, and testing containerized applications.

  • ShellHub

    ShellHub offers an innovative approach to remote access with minimal reconfiguration of a firewall.

  • Collabora and OnlyOffice

    Small businesses and organizations can benefit from products that expand on basic office suites to support collaborative work and that can be integrated with other services to suit individual business needs.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News