Seafile Server - Private Cloud

All you need is a Linux Ubuntu (Debian) home server and a little Linux configuration knowledge.

If you use Dropbox you will immediately understand how to use a Seafile.
Advantage of Seafile over Dropbox: your data will be stored inside your personal home-server and more functionality with Seafile, e.g. group working

Download Seafile
Deploying and Directory Layout
Seafile Server Set-up
Running Seafile Server

Setup Port Forwarding Rules

Download the latest server package.
#check if your system is x86 (32bit) or x86_64 (64 bit)
uname -m

#download for 32bit

#or for 64bit

Deploying and Directory Layout

If you place the Seafile data directory in external storage, such as NFS, CIFS mount, you should not use SQLite as the database, but use MySQL instead.
Supposed your organization's name is "haiwen", and you've downloaded seafile-server_1.4.0_* into your home directory. We suggest you to layout your deployment as follows :

mkdir haiwen
mv seafile-server_* haiwen
cd haiwen
# after moving seafile-server_* to this directory
tar -xzf seafile-server_*
mkdir installed
mv seafile-server_* installed

Now you should have the following directory layout

The benefit of this layout is that
- We can place all the config files for Seafile server inside "haiwen" directory, making it easier to manage.
- When you upgrade to a new version of Seafile, you can simply untar the latest package into "haiwen" directory. In this way you can reuse the existing config files in "haiwen" directory and don't need to configure again.

Setting Up 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
#on Ubuntu
apt-get update
apt-get install python2.7 python-setuptools python-simplejson python-imaging sqlite3


cd seafile-server-*
#run the setup script & answer prompted questions
If some of the prerequisites are not installed, the seafile initialization script will ask you to install them.

Running Seafile Server

Before Running
Since Seafile uses persistent connection between client and server, if you have a large number of clients , you should increase Linux file descriptors by ulimit before start seafile, like:
ulimit -n 30000

Starting Seafile Server and Seahub Website
Under seafile-server-1.4.0 directory, run the following commands
Start seafile:
./ start # Start seafile service
Start seahub:
./ start <port> # Start seahub website, port defaults to 8000
After starting the services, you may open a web browser and types

you will be redirected to the Login page. Enter the username and password you were provided during the Seafile setup. You will then be returned to the `Myhome` page where you can create libraries.
Congratulations! Now you have successfully setup your private Seafile server.


Run Seahub on another port
If you want to run seahub in a port other than the default 8000, say 8001, you must (1) stop the seafile server
./ stop
./ stop

(2) modify the value of SERVICE_URL in the file haiwen/ccnet/ccnet.conf, like this: (assume your ip or domain is


and (3) restart seafile server
./ start
./ start 8001

seeSeafile server configuration options for more details about ccnet.conf.


Stopping and Restarting Seafile and Seahub
./ stop # stop seahub website
./ stop # stop seafile processes

./ restart
./ restart


Setup Autostart on boot
On Ubuntu/Debain, we make use of the /etc/init.d/ scripts to start seafile/seahub at system boot.
Create a script /etc/init.d/seafile-server

sudo vim /etc/init.d/seafile-server

The content of this script is: (You need to modify the value of user and script_path accordingly)

# Change the value of "user" to your linux user name user=haiwen
# Change the value of "script_path" 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 start)
sudo -u ${user} ${script_path}/ start > ${seafile_init_log}
if [ $fastcgi = true ]; then
sudo -u ${user} ${script_path}/ start-fastcgi ${fastcgi_port} > ${seahub_init_log}
sudo -u ${user} ${script_path}/ start > ${seahub_init_log} fi
;; restart)
sudo -u ${user} ${script_path}/ restart > ${seafile_init_log}
if [ $fastcgi = true ];
sudo -u ${user} ${script_path}/ restart-fastcgi ${fastcgi_port} > ${seahub_init_log}
sudo -u ${user} ${script_path}/ restart > ${seahub_init_log} fi
sudo -u ${user} ${script_path}/ $1 > ${seafile_init_log}
sudo -u ${user} ${script_path}/ $1 > ${seahub_init_log}
echo "Usage: /etc/init.d/seafile {start|stop|restart}"
exit 1
;; esac

If you want to start seahub in fastcgi, just change the fastcgi variable to true
Create a file /etc/init/seafile-server.conf

start on (started mysql
and runlevel [2345])
stop on (stopping mysql
and 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-server

sudo ln -s /etc/init.d/seafile-server /etc/rc0.d/K12seafileserver
sudo ln -s /etc/init.d/seafile-server /etc/rc2.d/S12seafileserver


After reboot your Seafile server is automatically starts.

Setup Port Forwarding Rules

Seafile server is composed of several components. You need to configure port forward for all the components listed below.

  • ccnet 10001
  • seaf-server 12001
  • httpserver 8082
  • seahub 8000

- You don't need to open port 8000 and 8082 if you deploy Seafile behind Apache/Nginx.
- If you're not using the default ports, you should adjust the table accroding to your own customiztion.

If you are behind a restricted firewall, for eg workplace / office intranet and would like to use Seafile the following should be done:
install: putty
Create a SSH connection profile to your Seafile server with port forwards inside the tunnel.
It is under: Connection, SSH, Tunnels
Add the above 4 ports to the profile and save it.

Load the saved profile and login to your Seafile server.
Add a new account to your Windows Seafile client.
Here the servername: localhost:8000
User and password are the same as normally used for your Seafile server.
Click on connect, and now you should be able to reach your Seafile server inside a SSH secured tunnel.