Home / New Technology / How to install the Seafile file and sync system on Ubuntu
seafilehero.jpg

How to install the Seafile file and sync system on Ubuntu


Image: Jack Wallen

If, on the heels of the ownCloud/Nextcloud debacle, you’re looking for a solid, in-house cloud system, Seafile is one you shouldn’t overlook. Seafile is a powerful cloud-based file sync and team collaboration tool that you can deploy in-house on an existing Linux server. The system offers a host of features, including:

  • File syncing
  • Built-in file encryption
  • Collaboration
  • Create groups with file syncing, online file editing, and more
  • Create libraries (for separate syncing)
  • Automatic file conflict resolution
  • Share libraries, subdirectories, links, files, and more

Let’s look at the process of installing Seafile on a Ubuntu machine. I’ll be running the install on Ubuntu 16.04 and using MySQL as the database. I’ll assume you have your LAMP (Linux Apache MySQL PHP) server up and running.

SEE: Power checklist: Managing and troubleshooting cloud storage (Tech Pro Research)

First steps

The first thing you must do is download the latest Seafile server. Then, you need to create a directory to house the installation.

For my example, I created an editorial directory in my home directory (~/); you should base your Seafile install on your server directory structure and your needs. For the sake of simplicity, I’ll illustrate the installation based on my testing install.

Open a terminal window and create the editorial directory with the command mkdir ~/editorial. Now move the downloaded seafile-server_XXX_YY.tar.gz (XXX is the release number and YY is either x86-64 or i386) into the newly created ~/editorial directory and unpack it with the command:

tar xvzf seafile-server_*

Prepare the databases

Seafile requires three databases to be created, and we’ll manually create those databases in the MySQL shell. Enter the shell with the following command:

mysql -u root -p

Enter your mysql root user password, and you should be ready to work. If you installed MariaDB on your server, you’ll have to issue the above command with the elevated privileges of sudo, like so:

sudo mysql -u root -p

Once in the MySQL shell, issue the following commands:

  • create database `ccnet-db` character set = ‘utf8’;
  • create database `seafile-db` character set = ‘utf8’;
  • create database `seahub-db` character set = ‘utf8’;
  • create user ‘seafile’@’localhost’ identified by ‘seafile’;
  • GRANT ALL PRIVILEGES ON `ccnet-db`.* to `seafile`@localhost;
  • GRANT ALL PRIVILEGES ON `seafile-db`.* to `seafile`@localhost;
  • GRANT ALL PRIVILEGES ON `seahub-db`.* to `seafile`@localhost;
  • exit

Installing dependencies

There are a number of dependencies we must install before setting up Seafile:

  • python 2.7
  • python-setuptools
  • python-imaging
  • python-ldap
  • python-mysqldb
  • python-urllib3
  • python-memcache

To install the above, go back to your terminal window and issue the following command:

sudo apt-get install -y python2.7 libpython2.7 python-setuptools python-imaging python-ldap python-mysqldb python-memcache python-urllib3

Allow that installation to complete, and you’re ready to start setting up Seafile.

Seafile setup

From the terminal window, change into the ~/editorial/seafile-server-XXX directory (XXX is the release number) and issue the command ./setup-seafile-mysql.sh. When prompted, select [2] (because the databases have already been created) and answer the questions. The questions asked include:

  • mysql server host: localhost
  • mysql server port: 3306
  • root password: the root password for the MySQL server
  • mysql user for Seafile: seafile
  • password for Seafile user: seafile
  • ccnet database name: ccnet-db
  • Seafile database name: seafile-db
  • Seahub database name: seahub-db

After answering all the questions, you’ll be presented with your configuration for review. If everything is okay, hit Enter, and the setup will complete.

Running the server

There are two components that must be started:

Each of these are started from within the installation directory (in our case ~/editorial/seafile-server-5.1.3). To start these services, issue the following commands:

  • ./seafile.sh start
  • ./seahub.sh start

When you first run the seahub.sh script, you’ll be prompted to create an admin user/password. These credentials will be used for logging in to Seahub as the admin user. All other users are then created within the Seafile GUI.

Logging in

Point your browser to http://IP_OF_SERVER:8000/ (IP_OF_SERVER is the actual IP address of your Seafile server) and enter your admin credentials (Figure A).

Figure A

Figure A

Logging in to your Seafile admin account.

Image: Jack Wallen

You can start setting up groups, users, folders, shares, and more. Seafile is ready to serve!

A very worthy cloud storage contender

I have found Seafile to be a worthy contender for internal/external cloud storage and sync; it could easily give ownCloud, Nextcloud, or even Dropbox a run for their money. Give this server a try, and see if you don’t immediately find a place for it in your company.

Also see

About admin

mm

Check Also

05-22-17musgroveteena.jpg

How Micron is focusing on edge processing for smart IoT deployments

How Micron is focusing on edge processing for smart IoT deployments – TechRepublic How Micron ...

Leave a Reply

Your email address will not be published. Required fields are marked *