How can I install and configure Seafile on CentOS 8?. Seafile server is an open source, enterprise, self-hosted file hosting platform build for performance and high reliability. Seafile enables you to put files on your own server and allow your different devices to sync and access it. You can as well access all the files as a virtual disk. In this blog, we are going to look at how to install and configure Seafile file sharing server on CentOS 8.

The following are some of the important features of Seafile that makes a reliable file sharing platform:

  • File encryption
  • File locking
  • Online editing and co-authoring
  • File Versioning and Snapshot
  • Mobile File Access
  • Easy to install and use client
  • File Sharing and Permission Control

Install Seafile Storage Server on CentOS 8

These are the steps you’ll follow to install and configure Seafile Storage Server on CentOS 8 system.

Step 1: Update System and Set hostname

We will first disable CentOS selinux to ensure that it does not prevent any installation we are going to perform.

$ sudo vim /etc/selinux/config
# This file controls the state of SELinux on the system. 
# SELINUX= can take one of these three values: 
#     enforcing - SELinux security policy is enforced. 
#     permissive - SELinux prints warnings instead of enforcing. 
#     disabled - No SELinux policy is loaded. 
# SELINUXTYPE= can take one of these three values: 
#     targeted - Targeted processes are protected, 
#     minimum - Modification of targeted policy. Only selected processes are protected.  
#     mls - Multi Level Security protection. 

After disabling Selinux, run updates on your CentOS 8.

sudo dnf -y update
sudo dnf -y upgrade

Now configure hosts file and set server hostname

sudo hostnamectl set-hostname
echo “<your-server-ip>” | sudo tee -a /etc/hosts

Reboot your system

sudo reboot

Step 2: Add EPEL repo and install dependencies

First let us install Seafile dependencies and required packages

sudo dnf -y install epel-release
sudo dnf -y install python3 python3-imaging MySQL-python3 python3-simplejson python3-setuptools mariadb mariadb-server nginx

Step 3: Configure MariaDB Database Server

We have already installed MariaDB when installing dependencies. Let us go ahead to configure it. Start MariaDB and enable it to start on system boot.

sudo systemctl start mariadb
sudo systemctl enable mariadb

Secure mariadb installation and set root password.

$ sudo mysql_secure_installation
Enter current password for root (enter for none):  Press Enter
Set root password? [Y/n] y
New password:  Enter New Password
Re-enter new password:  Repeat New 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 
... Success! 
Cleaning up... 
All done!  If you've completed all of the above steps, your MariaDB

Step 4: Create Seafile Databases

Having configured MariaDB, we will go ahead to create Seafile user and databases. Connect to MySQL using the command below and type the password you set above.

mysql -u root -p 

We will create a user for Seafile and the following three databases:

  • ccnet_db
  • seafile_db
  • seahub_db

Once you connect to MySQL, run the following commands to create the required databases:

create database ccnet_db character set = 'utf8';
create database seafile_db character set = 'utf8';
create database seahub_db character set = 'utf8';
create user [email protected] identified by 'yourpassword';
grant all privileges on ccnet_db.* to [email protected] identified by 'yourpassword';
grant all privileges on seafile_db.* to [email protected] identified by 'yourpassword';
grant all privileges on seahub_db.* to [email protected] identified by 'yourpassword';
flush privileges;

Step 5: Install Seafile on CentOS 8

We are going to install Seafile in /var/www path.

sudo mkdir -p /var/www/seafile
cd /var/www/seafile

Download Seafile with wget command, and extract the downloaded archive.


Extract the downloaded file

sudo tar xvf seafile-server_7.1.5_x86-64.tar.gz 

Rename the directory to ‘seafile-server’ and switch to that directory.

 sudo mv seafile-server-7.1.5/ seafile-server

Step 6: Configure Seafile on CentOS 8

Execute the ‘‘ file to configure the database.

$ cd  seafile-server
$ sudo ./

Checking python on this machine ... 
This script will guide you to setup your seafile server using MySQL. 
Make sure you have read seafile server manual at 

Press ENTER to continue 
What is the name of the server? It will be displayed on the client. 
3 - 15 letters or digits 
[ server name ] seafile 
What is the ip or domain of the server? 
For example:, 
[ This server's ip or domain ]

Which port do you want to use for the seafile fileserver? 
[ default "8082" ]  

Please choose a way to initialize seafile databases: 

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

[ 1 or 2 ] 2 

What is the host of mysql server? 
[ default "localhost" ]  press Enter

What is the port of mysql server? 
[ default "3306" ]  Press Enter

Which mysql user to use for seafile? 
[ mysql user for seafile ] seacloud

What is the password for mysql user "seahub"? 
[ password for seahub ]  Enter seacloud password
verifying password of user seacloud ...  done 

Enter the existing database name for ccnet: 
[ ccnet database ] ccnet_db 

verifying user "seacloud" access to database ccnet_db ...  done 

Enter the existing database name for seafile: 
[ seafile database ] seafile_db 

verifying user "seacloud" access to database seafile_db ...  done 

Enter the existing database name for seahub: 
[ seahub database ] seahub_db 

verifying user "seacloud" access to database seahub_db ...  done 

This is your configuration 

   server name:            seafile 
   server ip/domain: 

   seafile data dir:       /var/www/seafile/seafile-data 
   fileserver port:        8082 

   database:               use existing 
   ccnet database:         ccnet_db 
   seafile database:       seafile_db 
   seahub database:        seahub_db 
   database user:          seacloud 
Press ENTER to continue, or Ctrl-C to abort


Generating ccnet configuration ... 

Successly create configuration dir /var/www/seafile/ccnet. 
Generating seafile configuration ... 

Generating seahub configuration ... 
Now creating ccnet database tables ... 

Now creating seafile database tables ... 

Now creating seahub database tables ... 


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

Your seafile server configuration has been finished successfully. 

run seafile server:     ./ { start | stop | restart } 
run seahub  server:     ./  { start <port> | stop | restart <port> } 

If you are behind a firewall, remember to allow input/output of these tcp ports: 

port of seafile fileserver:   8082 
port of seahub:               8000 

When problems occur, Refer to 

for information. 

Now we can start the seafile and seahub services. Start seafile with the below command:

$ sudo ./ start
[08/17/20 11:16:33] ../common/session.c(148): using config file /var/www/seafile/conf/ccnet.conf 
Starting seafile server, please wait ... 
** Message: seafile-controller.c(563): No seafevents. 

Seafile server started 


Start seahub service

$ ./ start
LC_ALL is not set in ENV, set to en_US.UTF-8 
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 ] [email protected] 

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

Enter the password again: 
[ admin password again ]  Repeat Admin password
Successfully created seafile admin 
!!! WARNING: configuration file should have a valid Python extension. 

Error:Seahub failed to start. 
Please try to run "./ start" again
Seahub Failed to start.

As you can see from the output above, seahub did not start. In order to get the associated error, start seafile with the command below:

$ sudo ./ start-fastcgi

from _sha1 import sha1 
ModuleNotFoundError: No module named '_sha1' 
Error:Seahub failed to start.

The output shows that the error is about sha1 which is not supported. I solved this by replacing “from _sha1 import sha1” with “import hashlib” in the file /var/www/seafile/seafile-server/seahub/seahub/repo_api_tokens/ The file appear as below:

$ sudo vim /var/www/seafile/seafile-server/seahub/seahub/repo_api_tokens/
import hashlib 
import hmac 
import uuid 
from django.db import models

Save the file and start seahub again

$sudo ./ start
LC_ALL is not set in ENV, set to en_US.UTF-8 
Starting seahub at port 8000 ... 
Seahub is started 

Step 7: Configure Firewall

If your filewall is active, ensure to open seafile ports through the firewall:

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

Step 8: Accessing Seafile on Browser

Access seafile from your browser using your hostname/Ip address on port 8000: http://<your-hostname>:8000. If you find that your seafile is not loading on browser, check seafile gunicorn configuration. Ensure that it does not bind to local IP address as shown below:

$ sudo vim /var/www/seafile/conf/
# default localhost:8000 
#bind =
bind = ""

Save the file and you should be able to lauch seafile on the browser. You should see a page as below:

Install and configure seafile on centos 8

Login with the admin credentials you configured earlier and you should get a page as shown:

Install and configure seafile on centos 8 1

To start adding new folders/files, click on ‘New Library’ and provide a name to your new folder then click ‘submit’.

Install and configure seafile on centos 8 2

You should be able to select your new library and either create or upload a folder/file.

Install and configure seafile on centos 8 3

Step 9: Configure Seafile Client

We will use Ubuntu 20.04 Client machine to test connectivity to the Seafile Server.

To connect to Seafile on Ubuntu 20.04, first run the below command to install seafile client on Ubuntu 20.04

$ sudo wget -O /usr/share/keyrings/seafile-keyring.asc
$ sudo bash -c "echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/seafile-keyring.asc] stable main' > /etc/apt/sources.list.d/seafile.list"
$ sudo apt update
$ sudo apt install -y seafile-gui

For cli use only, run the command:

sudo apt-get install seafile-cli

Once installed, search for seafile client on your applications and you should see it.

Install and configure seafile on centos 8 5

Double click to open and choose a folder for your libraries and click next

Install and configure seafile on centos 8 4 1

Now provide particulars for your seafile server to connect to:

Install and configure seafile on centos 8 6 2

When you click ‘Login’ you should be connected to your seafile server as shown:

Install and configure seafile on centos 8 7 1

That’s it. Enjoy using your Seafile installation. I hope the blog has been informative. Check more interesting guides below:

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!

As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.


Please enter your comment!
Please enter your name here