Feb 252013
 

In the past I’ve tested ownCloud a good solution for hosting a personal solution of cloud storage for your files, or perhaps your team, but there is also an interesting alternative: Seafile another open source file synchronization tool, it comes with Dropbox-like file syncing, but is designed to be better suited to teamwork with some of the features that are oriented to this such as:

1) Users can create and join groups, then share files to the group. This makes it convenient for teamwork.
2) Files are organized into libraries, each be selectively synced to your computer. Libraries can be synced with any local folders.
3) Online file collaboration features, such as PDF and Office file preview and file commenting.

You can build a file sharing and syncing service for your team on your servers with ease.


Internal

Seafile uses GIT’s version control model, but simplified for automatic synchronization, and doesn’t depend on GIT. Every library is like a GIT repository. It has its own unique history, which consists of a list of commits. A commit points to the root of a file system snapshot. The snapshot consists of directories and files. Files are further divided into blocks for more efficient network transfer and storage usage.

Differences to GIT:

  1. Automatic syncing.
  2. Clients do not store file history, thus avoids the overhead of storing data twice. GIT is not efficient for larger files (such as images).
  3. Files are further divided into blocks for more efficient network transfer and storage usage.
  4. File transfer can be resumed.
  5. Support different storage backends on the server side.
  6. Support downloading from multiple block servers for accelerating file transfer.
  7. More user-friendly file conflicts handling similar to Dropbox (Add user’s name as suffix to conflicted file).

Installation

The sources of this project are hosted on github, or as alternative you can grab a .tar.gz from official download page.

In this example I’ll do an installation on a Centos 6/RHEL 6 server at 64 bit.

cd /tmp/
wget http://seafile.googlecode.com/files/seafile-server_1.4.5_x86-64.tar.gz

Prerequisites

Before continuing it’s time to install the requisite softwares needed by Seafile (server).
The Seafile server package requires the following packages have been installed in your system

  • python 2.6 or 2.7
  • python-setuptools
  • python-simplejson
  • python-imaging
  • sqlite3

To install them on Centos/RHEL 6 you can use the following command:

yum -y install sqlite python-simplejson python-setuptools python-imaging

Now we uncompress the tar package that we have downloaded in the /tmp directory and create a structure to keep the source and configuration

cd /opt/
mkdir seafile  
mv /tmp/seafile-server_* seafile
cd seafile
tar -xzf seafile-server_*
mkdir installed
mv seafile-server_* installed

This sequence of commands will create a structure like this one:

#tree seafile -L 2
seafile
├── installed
│   └── seafile-server_1.4.5_x86-64.tar.gz
└── seafile-server-1.4.5
    ├── reset-admin.sh
    ├── runtime
    ├── seafile
    ├── seafile.sh
    ├── seahub
    ├── seahub.sh
    ├── setup-seafile.sh
    └── upgrade

The benefit of this layout is that we can place all the config files for Seafile server inside “seafile” directory.
When you upgrade to a new version of Seafile, you can simply untar the latest package into “linuxaria” directory. In this way you can reuse the existing config files in “seafile” directory and don’t need to configure everything again.


Setup script

Now it’s time to setup our seafile server, as first thing create a new user that will be used to run the seafile services:

useradd -d /opt/seafile seafile
chown -R seafile. /opt/seafile
su - seafile
cd /opt/seafile/seafile-server-1.4.5
./setup-seafile.sh

A textual wizard will ask some information for the correct setup of your seafile server:

-----------------------------------------------------------------
This script will guide you to config and setup your seafile server.
 
Make sure you have read seafile server manual at 
 
	https://github.com/haiwen/seafile/wiki
 
Press [ENTER] to continue
-----------------------------------------------------------------
 
Checking packages needed by seafile ...
 
Checking python on this machine ...
Find python: python2.6
 
  Checking python module: setuptools ... Done.
  Checking python module: python-simplejson ... Done.
  Checking python module: python-imaging ... Done.
  Checking python module: python-sqlite3 ... Done.
 
Checking for sqlite3 ...Done.
 
Checking Done.
 
What do you want to use as the name of this seafile server?
Your seafile users would see this name in their seafile client.
You can use a-z, A-Z, 0-9, _ and -, and the length should be 3 ~ 15
[server name]: linuxaria               
 
What is the ip or domain of this server?
For example, www.mycompany.com, or, 192.168.1.101
 
[This server's ip or domain]: www.linuxaria.com
 
What tcp port do you want to use for ccnet server?
10001 is the recommended port.
[default: 10001 ] 
 
Where do you want to put your seafile data? 
Note: Please use a volume with enough free space.
[default: /opt/seafile/seafile-data ] 
 
This is your config information:
 
server name:        linuxaria
server ip/domain:   www.linuxaria.com
server port:        10001
...

Now, just press enter and you should see the successfull end of the first phase, in the second part you’ll be asked for an email address and a password for Seahub, the web interface for seafile server and at the end you should a summary like this one:

-----------------------------------------------------------------
Your seafile server configuration has been finished successfully.
-----------------------------------------------------------------
 
run seafile server:     ./seafile.sh { start | stop | restart }
run seahub  server:     ./seahub.sh  { start  | stop | restart  }
 
-----------------------------------------------------------------
If you are behind a firewall, remember to allow input/output of these tcp ports:
-----------------------------------------------------------------
 
port of ccnet server:         10001
port of seafile server:       12001
port of seafile httpserver:    8082
port of seahub:               8000

Start Seafile Server

Now you can become the user seafile and start the server:

su - seafile
/opt/seafile/seafile-server-1.4.5/seafile.sh start
/opt/seafile/seafile-server-1.4.5/seahub.sh start

After these 2 command, you may open a web browser and types

http://www.linuxaria.com:8000/

you will be redirected to the Login page. Enter the username and the password you provided during Seafile setup:

seafile

After the login you will be returned to the `Myhome` page where you can create libraries, these are used in seafile to organize your files. For example, you can create one for each of your projects. Each library can be synchronized and shared separately.

seafile02

Congratulations! Now you have successfully setup your private Seafile server.

Seafile client

Seafile client are available for Windows, Mac OS X, Linux (ubuntu 12.04 or newer), android and Ipad/Iphone.
Or it’s possible to install the client, directly from the source.

At the moment the Seafile Linux client consists of an AppIndicator/tray icon that displays the sync status and lets you open the client (in the browser), disable autosync or restart Seafile, displays sync notifications, and a pretty basic web interface.

This is just a basic setup but there are other options, such as using mysql server or Apache/nginx as webserver that should allow to scale up easily the number of users that can use simultaneously your service:

Reference:

Seafile: Robust File Synchronization And Collaboration Tool That You Can Run On Your Linux Server

Popular Posts:

Flattr this!

  5 Responses to “Installation of Seafile, open source Dropbox alternative for teams”

  1. When you upgrade to a new version of Seafile, you can simply untar the latest package into “linuxaria” directory. In this way you can reuse the existing config files in “seafile” directory and don’t need to configure everything again.
    What is this “linuxaria” directory of which you speak? Looks like something got mangled in edit.

    • Ouch, sorry I made an example with /opt/linuxaria, but then I’ve thought that a generic seafile would have been beter.

      So it’s seafile.

      Now correcting the article.

      Thanks Tom.

  2. Thank you for this great How-To. I have never heard of SeaFile before, but feel this will work a little better than OwnCloud in my situation. Thank you very much!

  3. Does anyone know of a better sync client for windoze and Linux? I have tried Rsync, Unison but its too slow for larger files. Also webdav used in ownCloud may be compatible, but chokes on big files. What is the solution for syncing large GB files for a digital signage or an offsite backup? I can’t seem to get it faster than 147kbps using rsync over ssh

  4. hi,

    you’re saying that seafile supports a multi-server setup. do you perhaps now where to find a guide or some other documentation about this. Cause i’m wondering if its actually implemented already. If so i would really like to set this up on our own system.

    thanks in advance,
    Tim

Leave a Reply to linuxari Cancel reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

*