How to Install Seafile Server on CentOS 7

Updated on November 21, 2023
How to Install Seafile Server on CentOS 7 header image

Seafile (community version) is a free and open source file syncing and sharing solution which is similar to ownCloud.

Along with excellent performance and reliability, Seafile (community version) offers extraordinary features, like built-in file encryption, de-duplication, compression, and full file revision history. Besides, thanks to its great web front-end and multi-platform syncing clients, you can always access your files easily and quickly.

In this article, I will show you how to install the server-side program of Seafile (community version) on a Vultr CentOS 7 server instance.

Prerequisites

Before diving in, you should have:

  • Deployed a Vultr CentOS 7 server instance from scratch.
  • Logged in this machine from an SSH terminal, using a non-root user who was granted sudo privileges.

Step 1: Update your CentOS 7 system

For security and performance purposes, update your system to the latest stable status:

sudo yum install epel-release
sudo yum update -y && sudo reboot

Step 2: Install dependencies

Install the following dependencies:

sudo yum install python python-setuptools python-imaging python-ldap python-memcached MySQL-python mariadb mariadb-server

Start and enable the MariaDB service:

sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

Run the secure MySQL installation procedure:

sudo /usr/bin/mysql_secure_installation

Finish this procedure according to the following instructions:

Enter current password for root (enter for none): enter
Set root password? [Y/n]: Y
New password: <your-password>
Re-enter new password: <your-password>
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: Y
Remove test database and access to it? [Y/n]: Y
Reload privilege tables now? [Y/n]: Y

Now you will be prompted to set a new password for the MySQL admin user "root". Remember this password, because you will need it later in the tutorial.

Step 3: Download and uncompress the Seafile server archive

Download and unpack the latest version of the Seafile server archive (5.1.2 at the time of writing).

cd ~
wget https://bintray.com/artifact/download/seafile-org/seafile/seafile-server_5.1.2_x86-64.tar.gz
tar -zxvf seafile-server_5.1.2_x86-64.tar.gz
sudo mkdir -p /opt/seafile/installed
sudo mv seafile-server_5.1.2_x86-64.tar.gz /opt/seafile/installed
sudo mv seafile-server-5.1.2/ /opt/seafile

Step 4: Install Seafile

Install Seafile by running the installation script:

cd /opt/seafile/seafile-server-5.1.2
sudo ./setup-seafile-mysql.sh

The script is interactive. During the installation, you will need to:

  • Provide server name, server IP, and MySQL root password.
  • Choose 1 to install new databases.
  • Use the default values for all other options.

After the installation finishes, run the following commands to start Seafile server and setup an admin user account:

sudo ./seafile.sh start
sudo ./seahub.sh start

Step 5: Modify firewall rules

In order to allow web access and file syncing between the Seafile server and clients, you need to modify firewall rules using these commands:

sudo firewall-cmd --zone=public --permanent --add-port=8082/tcp
sudo firewall-cmd --zone=public --permanent --add-port=8000/tcp
sudo firewall-cmd --reload

Finally, it's time to install Seafile clients on your desktop or cellphone to sync your files. You can manage your Seafile server by visiting this address:

http://<your-Vultr-server-IP>:8000