Create A Secure Cloud Storage Using Seafile In Ubuntu 14.10


Seafile  :

is an open source cloud storage system with advanced support for file syncing, privacy protection and teamwork. It allow users TO Organize files into libraries. Each library can be shared between users and into groups. A library can also be selectively synced into any device..

Also Seafile allow access files from mobile devices. Notifications and messages make it easy to connect with team members.

In this guide, we will try to make our own cloud storage through setting up a seafile server on an Ubuntu 14.04 VPS instance. We can then use this solution to upload and interact with files through a web interface, or configure syncing local directories.

Seafile Concept

Seafile and its desktop and mobile clients are published under the GPLv3.


Before installing Seafile, make sure that you you have installed LAMP server under you vps.

sudo apt-get install apache2 mysql-server php5 libapache2-mod-php5

In production environment it’s recommend using MySQL as the database and config Seafile web behind Nginx or Apache. In our case we will use Apache server.

The Seafile server package requires the following packages have been installed in your system:

sudo apt-get install sqlite python-simplejson python-setuptools python-imaging

Installation of Seafile server

Let’s start now the installation of Seafile server. You need to create directory  where you will put the source package and config files and ‘/etc/seafile/install/’ directory to put the installation files of Seafile server.

You need to download the last relase of Seafile server from this link:

[root@ubuntutest ~]# mkdir /etc/seafile 
[root@ubuntutest ~]# mkdir /etc/seafile/install
[root@ubuntutest ~]# cd /etc/seafile/ 
[root@ubuntutest seafile]# wget[root@ubuntutest seafile]# tar -xzf seafile-server_4.0.5_x86-64.tar.gz

Then move the extracted seafile-server-4.0.5 files to ‘/ect/seafile/install/’ directory.

[root@server seafile]# mv seafile-server* install/

Now goto the ‘/opt/seafile/install/seafile-server-4.0.5/’ directory and run the installation script.

root@ubuntutest:/etc/seafile/install/seafile-server-4.0.5# ./ 

You are running this script as ROOT. Are you sure to continue? 
[yes|no] yes  ## Type yes and press enter ##


This script will guide you to config and setup your seafile server.

Make sure you have read seafile server manual at

Note: This script will guide your to setup seafile server using sqlite3,

which may have problems if your disk is on a NFS/CIFS/USB.

In these cases, we sugguest you setup seafile server using MySQL.

Press [ENTER] to continue ## Type enter to continue ##


checking packages needed by seafile ...

Checking python on this machine ...

Find python: python2.7

Checking python module: setuptools ... Done.

Checking python module: python-imaging ... Done.

Checking python module: python-sqlite3 ... Done.

Checking for sqlite3 ...Done.

Checking Done.

What would you like to use as the name of this seafile server?

Your seafile users will be able to see the name in their seafile client.

You can use a-z, A-Z, 0-9, _ and -, and the length should be 3 ~ 15

[server name]: ubuntu ## Enter the server hostname ##

What is the ip or domain of this server?

For example,, or,

[This server's ip or domain]: ## Enter FQDN name or ip-address ##

What tcp port do you want to use for ccnet server?

10001 is the recommended port.

[default: 10001 ] ## Press Enter ##

Where would you like to store your seafile data?

Note: Please use a volume with enough free space.

[default: /etc/seafile/install/seafile-data ] ## Press Enter ##

What tcp port would you like to use for seafile server?

12001 is the recommended port.

[default: 12001 ] ## Press Enter ##

What tcp port do you want to use for seafile fileserver?

8082 is the recommended port.

[default: 8082 ] ## Press Enter ##

This is your config information:

server name: ubuntu

server ip/domain:

server port: 10001

seafile data dir: /etc/seafile/install/seafile-data

seafile port: 12001

fileserver port: 8082

If you are OK with the configuration, press [ENTER] to continue.

Generating ccnet configuration in /etc/seafile/install/ccnet...


Successly create configuration dir /etc/seafile/install/ccnet.

Generating seafile configuration in /etc/seafile/install/seafile-data ...

Seahub is the web interface for seafile server.

Now let's setup seahub configuration. Press [ENTER] to continue

Creating seahub database now, it may take one minute, please wait...

creating seafile-server-latest symbolic link ... done

Your seafile server configuration has been completed successfully.
run seafile server: ./ { start | stop | restart }
run seahub server: ./ { start <port> | stop | restart <port> }

If the server is behind a firewall, remember to open these tcp ports:
port of ccnet server: 10001
port of seafile server: 12001
port of seafile fileserver: 8082
port of seahub: 8000

When problems occur, refer to
for more information.

Now run the ‘’ and ‘’ scripts to start the Seafile server.

[root@server seafile-server-1.6.1]# ./ start

Starting seafile server, please wait ...
Seafile server started

root@ubuntutest:/etc/seafile/install/seafile-server-4.0.5# ./ start

Starting seahub at port 8000 ...

It's the first time you start the seafile server. Now let's create the admin account

What is the email for the admin account?
[ admin email ] ## Enter the admin email id ##

What is the password for the admin account?
[ admin password ] ## Enter admin password ##

Enter the password again:
[ admin password again ]  ## Retype password ##

Successfully created seafile admin

Loading ccnet config from /etc/seafile/install/ccnet
Loading seafile config from /etc/seafile/install/seafile-data

Seahub is started



Start Seafile at System Bootup

To easily control your Seafile server, you must set it up as an Ubuntu service. You need to use of the /etc/init.d/ scripts to start seafile/seahub at system boot

You need to make the startup script for the Seafile server like this:

vi /etc/init.d/seafile

After that copy this configuration and save it into the file


# Change the value of "user" to your linux user name

# Change the value of "seafile_dir" to your path of seafile installation

# Change the value of fastcgi to true if fastcgi is to be used
# Set the port of fastcgi, default is 8000. Change it if you need different.

case "$1" in
                sudo -u ${user} ${script_path}/ start &gt;&gt; ${seafile_init_log}
                if [  $fastcgi = true ];
                        sudo -u ${user} ${script_path}/ start-fastcgi ${fastcgi_port} &gt;&gt; ${seahub_init_log}
                        sudo -u ${user} ${script_path}/ start &gt;&gt; ${seahub_init_log}
                sudo -u ${user} ${script_path}/ restart &gt;&gt; ${seafile_init_log}
                if [  $fastcgi = true ];
                        sudo -u ${user} ${script_path}/ restart-fastcgi ${fastcgi_port} &gt;&gt; ${seahub_init_log}
                        sudo -u ${user} ${script_path}/ restart &gt;&gt; ${seahub_init_log}
                sudo -u ${user} ${script_path}/ $1 &gt;&gt; ${seafile_init_log}
                sudo -u ${user} ${script_path}/ $1 &gt;&gt; ${seahub_init_log}
                echo "Usage: /etc/init.d/seafile {start|stop|restart}"
                exit 1

Add Directory for Logfiles

 mkdir /path/to/seafile/dir/logs

Create a file /etc/init/seafile.conf,

If you’re not using MySQL:

start on (runlevel [2345])
stop on (runlevel [016])

pre-start script
/etc/init.d/seafile-server start
end script

post-stop script
/etc/init.d/seafile-server stop
end script

If you’re using MySQL:

start on (started mysql
and runlevel [2345])
stop on (runlevel [016])

pre-start script
/etc/init.d/seafile-server start
end script

post-stop script
/etc/init.d/seafile-server stop
end script

Make the seafile-sever script executable:

sudo chmod +x /etc/init.d/seafile


Don’t forget to update the value of script_path later if you update your seafile server.

Now try using the service and command to start a new Seafile server instance:

service seafile start

Firewall settings

By default, you should open 4 ports in your firewall settings.

 | Seahub
    | 8000
    | FileServer
    | 8082
    | Ccnet Daemon
    | 10001
    | Seafile Daemon
    | 12001

If you run Seafile behind Nginx/Apache with HTTPS, you should open ports

    | 443
    | Ccnet Daemon
    | 10001
    | Seafile Daemon
    | 12001

Seafile web configuration

Now navigate to your web browser using “http://ip-address:8000″ or “http://your-domain-name:8000/”.

In this example, we will use this URL:

The following screen should appear when you enter the URL “http://ip-address:8000″. Enter the admin email id and password to login  which you have created at the time of installation.


Now after log on you can manage and create your files, users, contacts, groups, libraries.


if you want to create others users that you can share with them files, you need to under administration page and create new account.


Now you have created new user that can share with you files, folders etc …


Setting up Seafile Clients

Seafile clients is available to download in a variety of formats for many different devices and operating systems. Windows, Mac OS, Linux, Android, iOS, and a generic terminal client are all supported for the desktop client, while the server side is available for Windows, Linux and Raspberry Pi.  You can download Seafile clients from this link.


This example to show you how to use Seafile client for windows os.

Choose the address of you server  for example and enter in your login details, then you’ll see your libraries.


At any stage, you can add more Seafile accounts from private web servers. It’s quite easy to then switch between the accounts as you require.


Enjoy, now you  have your own storage cloud platform.