Tutorial

How To Install and Configure Seafile on an Ubuntu 12.04 VPS

Published on March 6, 2014
How To Install and Configure Seafile on an Ubuntu 12.04 VPS

Status: Deprecated

This article covers a version of Ubuntu that is no longer supported. If you are currently operate a server running Ubuntu 12.04, we highly recommend upgrading or migrating to a supported version of Ubuntu:

Reason: Ubuntu 12.04 reached end of life (EOL) on April 28, 2017 and no longer receives security patches or updates. This guide is no longer maintained.

See Instead: This guide might still be useful as a reference, but may not work on other Ubuntu releases. If available, we strongly recommend using a guide written for the version of Ubuntu you are using. You can use the search functionality at the top of the page to find a more recent version.

Introduction

Hosting your files and sharing content between team members can be accomplished in quite a few ways. Services like DropBox are very popular for this purpose, and have gained traction over time, both for personal and business use.

However, many users prefer to have more ownership over their data. Instead of placing their files in a black box on a server operated by a company, setting up a self-hosted solution is sometimes more ideal.

Seafile is one elegant solution to this problem. We can set up a seafile server on our VPS in order to act as a central location to sync data with multiple clients and share files across an organization.

In this guide, we will walk through setting up a seafile server on an Ubuntu 12.04 VPS instance. We can then use this to upload and interact with files through a web interface, or configure syncing local directories.

Configure the Prerequisites

Before we begin, we need to acquire some of the dependencies that seafile needs in order to run.

Seafile uses an *SQL database to store some of its information. Because of this, we are going to install MySQL from Ubuntu’s repositories.

SQLite is another option, but is not as robust as a real database, so we’ll set up MySQL from the start in order to accommodate growth in the future. PostgreSQL is another option that would work just as well, but we won’t be covering that in this guide.

We will also have to acquire some Python libraries. Luckily, these are all found in the default repositories. Update the package cache and install them now:

sudo apt-get update
sudo apt-get install mysql-server python-imaging python-mysqldb

You will be asked to select an administrative password for your MySQL database upon installation. Remember you choice, as you will need it later.

We can do a bit of MySQL housekeeping before we begin installing our service. First, initialize the MySQL data directory:

sudo mysql_install_db

Next, we can run a security script that asks us some questions in order to lock down some settings:

sudo mysql_secure_installation

You will be asked to enter the administrative password that you set up during the database installation.

Afterwards, you will be asked a series of questions. Press “enter” to accept the defaults at each of the prompts except for the question about changing the root password.

You should now have all of the required dependencies and be ready to continue with the installation.

Download the Seafile Components

We will be getting the seafile components from their website. This link has the required tarballs that we will use to install the software.

Go to that page, and scroll down until you get to the “Server” section. Under “Server for generic Linux”, right-click on the link that is associated with the architecture of your droplet. Click “Copy link address” or whatever similar option is available.

On your droplet, you’ll want to make a new directory to house the seafile files. After the configuration step, more directories are created, which can clutter your home directory.

mkdir seafile

Change into the directory and type wget, a space, and then paste the link that you copied from the website. In my case, it looked like this:

cd seafile
wget https://bitbucket.org/haiwen/seafile/downloads/seafile-server_2.1.5_x86-64.tar.gz

Extract the tarball into the current directory:

tar xzvf seafile-server*

Move into the directory that has been extracted:

cd seafile-server*

Configure the Seafile Service


Now that we have all of the project’s files, we can run a simple script to configure our database and set up our server.

In the extracted directory, run the setup script by typing:

./setup-seafile-mysql.sh

It will check that you have the proper prerequisites installed and available. Since we already took care of this in the first stage, this should pass without a problem. Type “enter” to begin running the script:

What is the name of the server? It will be displayed on the client.
3 - 15 letters or digits
[ server name ]

First, you will be asked to select a name for your server. This is completely personal preference and you can name it whatever you’d like.

What is the ip or domain of the server?
For example: www.mycompany.com, 192.168.1.101
[ This server's ip or domain ]

Enter the domain name that you have set up for your VPS, or enter the IP address that you’ve been given.

The next four questions are about the default ports of various components and the default directory to store your files. It’s safe to press “enter” to accept the default values if you don’t have a good reason to change them.

----------------------------------------
Now let's create the admin account
----------------------------------------

What is the email for the admin account?
[ admin email ]

Select an email and password for your first administrator account.

-------------------------------------------------------
Please choose a way to initialize seafile databases:
-------------------------------------------------------

[1] Create new ccnet/seafile/seahub databases
[2] Use existing ccnet/seafile/seahub databases

Since we did not set up our databases manually, we will select 1 in order to create new databases. You will be asked for the host and port of the MySQL server. Select the defaults unless you modified them in the MySQL configuration files.

Enter the administrator password of the MySQL root user.

Enter the name for mysql user of seafile. It would be created if not exists.
[ default "root" ]

Next, select a username that will be used to administer the seafile databases. You should select a new name, which is separate from the root account for best security.

We will use “seafile” for ease of use here, but it can be anything that isn’t already used for another purpose. Select an associated password as well.

Press enter to the questions asking about the name for each database because the defaults should be fine.

You now should have a summary of your selections printed to the screen:

---------------------------------
This is your configuration
---------------------------------

    server name:            DigitalOcean
    server ip/domain:       111.111.111.111
    ccnet port:             10001

    seafile data dir:       /home/demouser/seafile/seafile-data
    seafile port:           12001
    httpserver port:        8082

    admin email:            user@example.com
    admin password:         ******

    database:               create new
    ccnet database:         ccnet-db
    seafile database:       seafile-db
    seahub database:        seahub-db
    database user:          seafile



---------------------------------
Press ENTER to continue, or Ctrl-C to abort
---------------------------------

Press “enter” if this looks correct. The script will execute, making the changes that you’ve configured.

Starting the Seafile Services

The services are now configured and ready to start.

First, we will start the seafile service. This daemon controls the file transfers and data sharing functionality.

We can start it like this:

./seafile.sh start

Afterwards, we’ll want to start up the “seahub” daemon as well. This will provide us with a web interface to interact with our new software. We can start it like this:

./seahub.sh start

A simple Python web server will be started at port 8000. In your web browser, you can access the interface by visiting:

<pre> <span class=“highlight”>your_ip_or_domain</span>:8000 </pre>

You will be presented with the default login page:

Seafile initial login page

Enter the administrator email address and password that you chose during the configuration stage. You will be presented with main sharing page for your user:

Seafile user home

From here, you can click on “My Library” to get started on uploading files to your server.

If you wish to set up syncing, there are client applications available on all major platforms, including mobile. You can find and install them here.

Conclusion

You should now have a server configured with file sharing capabilities for you and your team. The seafile client-server model provides an easy way to keep everybody’s information connected and available. You can easily transfer repositories between users, add and remove team members from projects, etc. Explore the system to see what options are available.

<div class=“author”>By Justin Ellingwood</div>

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about us


About the authors

Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?
 
10 Comments


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

hello i m alrady configured server it successuly installed but problem is that i cannot open the web interference … i m also try with port 10001, 8082, 8000,

tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 4543/master tcp 0 0 0.0.0.0:7993 0.0.0.0:* LISTEN 3715/java tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 3969/nginx.conf tcp 0 0 0.0.0.0:7995 0.0.0.0:* LISTEN 3715/java tcp 0 0 0.0.0.0:8443 0.0.0.0:* LISTEN 3715/java tcp 0 0 0.0.0.0:7071 0.0.0.0:* LISTEN 3715/java tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN 8474/python2.7 tcp 0 0 127.0.0.1:23232 0.0.0.0:* LISTEN 4002/perl tcp 0 0 0.0.0.0:7072 0.0.0.0:* LISTEN 3715/java tcp 0 0 0.0.0.0:12001 0.0.0.0:* LISTEN 8397/seaf-server tcp 0 0 127.0.0.1:23233 0.0.0.0:* LISTEN 4006/perl tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 3969/nginx.conf tcp 0 0 0.0.0.0:7073 0.0.0.0:* LISTEN 3715/java tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 3969/nginx.conf tcp 0 0 127.0.0.1:7171 0.0.0.0:* LISTEN 1700/java tcp 0 0 182.163.126.119:389 0.0.0.0:* LISTEN 1658/slapd tcp 0 0 0.0.0.0:5222 0.0.0.0:* LISTEN 3715/java tcp 0 0 0.0.0.0:7110 0.0.0.0:* LISTEN 3715/java tcp 0 0 0.0.0.0:7143 0.0.0.0:* LISTEN 3715/java tcp 0 0 127.0.0.1:10663 0.0.0.0:* LISTEN 3634/zmlogger: zmrr tcp 0 0 127.0.0.1:10024 0.0.0.0:* LISTEN 4068/amavisd (maste tcp 0 0 127.0.0.1:10025 0.0.0.0:* LISTEN 4543/master tcp 0 0 127.0.0.1:13418 0.0.0.0:* LISTEN 8394/ccnet-server tcp 0 0 127.0.0.1:10026 0.0.0.0:* LISTEN 4068/amavisd (maste tcp 0 0 127.0.0.1:7306 0.0.0.0:* LISTEN 3624/mysqld tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 998/mysqld tcp 0 0 127.0.0.1:10027 0.0.0.0:* LISTEN 4543/master tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 4543/master tcp 0 0 0.0.0.0:11211 0.0.0.0:* LISTEN 3945/memcached tcp 0 0 127.0.0.1:10028 0.0.0.0:* LISTEN 4543/master tcp 0 0 127.0.0.1:10029 0.0.0.0:* LISTEN 4543/master tcp 0 0 127.0.0.1:10030 0.0.0.0:* LISTEN 4543/master tcp 0 0 127.0.0.1:3310 0.0.0.0:* LISTEN 4296/clamd tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 3969/nginx.conf tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 3969/nginx.conf tcp 0 0 127.0.0.1:10032 0.0.0.0:* LISTEN 4068/amavisd (maste tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 3715/java tcp 0 0 0.0.0.0:10001 0.0.0.0:* LISTEN 8394/ccnet-server tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 4543/master tcp 0 0 127.0.0.1:8465 0.0.0.0:* LISTEN 4315/opendkim tcp 0 0 0.0.0.0:7025 0.0.0.0:* LISTEN 3715/java tcp 0 0 0.0.0.0:8082 0.0.0.0:* LISTEN 8403/httpserver tcp 0 0 0.0.0.0:5269 0.0.0.0:* LISTEN 3715/java tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 3267/unbound tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 983/sshd tcp6 0 0 :::7780 :::* LISTEN 4342/httpd tcp6 0 0 ::1:10024 :::* LISTEN 4068/amavisd (maste tcp6 0 0 ::1:10026 :::* LISTEN 4068/amavisd (maste tcp6 0 0 :::11211 :::* LISTEN 3945/memcached tcp6 0 0 ::1:3310 :::* LISTEN 4296/clamd tcp6 0 0 ::1:10032 :::* LISTEN 4068/amavisd (maste tcp6 0 0 :::80 :::* LISTEN 1263/apache2 tcp6 0 0 :::22 :::* LISTEN 983/sshd

please help

Hi,

How can I enable SSL?

I forgot to say that I installed this time the 2.1.5 version, sorry. None of them works, but with 8082 I get a blank page

Kamal Nasser
DigitalOcean Employee
DigitalOcean Employee badge
April 10, 2014

@d.neufeld: Looks like it’s different in version 3.*, try browsing to these ports: 10001, 8082, 8000, 12001.

Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:13418 0.0.0.0:* LISTEN 3014/ccnet-server tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 8808/mysqld tcp 0 0 0.0.0.0:10001 0.0.0.0:* LISTEN 3014/ccnet-server tcp 0 0 0.0.0.0:8082 0.0.0.0:* LISTEN 3032/httpserver tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 8474/sshd tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN 3517/python2.7 tcp 0 0 0.0.0.0:12001 0.0.0.0:* LISTEN 3031/seaf-server tcp6 0 0 :::22 :::* LISTEN 8474/sshd

Kamal Nasser
DigitalOcean Employee
DigitalOcean Employee badge
April 10, 2014

@d.neufeld: What port is it listening on? <pre>sudo netstat -plutn</pre>

Ok, the setup worked after I recreate the vserver. Both seafile services started correctly, but I cannot open the webinterface? I open the same url as shown in the config file of seafile. What should I do?

Its Ubuntu 12.04 LTS

Kamal Nasser
DigitalOcean Employee
DigitalOcean Employee badge
April 10, 2014

@d.neufeld: What version of Ubuntu are you using? <pre>lsb_release -a</pre>It could be that the install steps are different on other OS versions.

uname - a gives me this: x86_64

So the server is 64bit. An I downloaded this: seafile-server_3.0.0.beta_x86-64.tar.gz

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Join the Tech Talk
Success! Thank you! Please check your email for further details.

Please complete your information!

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel