Support Online
Skip to main content

Installing Seafile in Ubuntu 20.04: Your Own Cloud Storage Platform

Seafile is an open source file synchronization and sharing platform that allows you to host your files on your own server.
In this guide, we will install Seafile securely on Ubuntu 20.04 using Apache + MariaDB.

What Will You Learn in This Guide?

  • Creating a database for Seafile components
  • Configuring Apache as a reverse proxy
  • Providing secure access with HTTPS
  • Automatically start Seafile services
  • Testing file synchronization

Prerequisites

  • Ubuntu 20.04 (at least 2 GB RAM)
  • sudo authorized user
  • Installed MariaDB
  • Installed Apache + Virtual Host
  • SSL certificate with Let's Encrypt
  • Domain name (exemplified by ornek.com)

1. Creating MariaDB Databases

Seafile uses three separate databases:

  • ccnetdb
  • seafiledb
  • seahubdb

1. Connect to MariaDB:

sudo mariadb
  • This command opens the database management console.

2. Create user:


CREATE USER 'genix_user'@'localhost' IDENTIFIED BY 'GUCLU_PAROLA';

3. Create the databases:


CREATE DATABASE `ccnetdb` CHARACTER SET = 'utf8';
CREATE DATABASE `seafiledb` CHARACTER SET = 'utf8';
CREATE DATABASE `seahubdb` CHARACTER SET = 'utf8';

4. Assign permissions:


GRANT ALL PRIVILEGES ON `ccnetdb`.* TO 'genix_user'@'localhost';
GRANT ALL PRIVILEGES ON `seafiledb`.* TO 'genix_user'@'localhost';
GRANT ALL PRIVILEGES ON `seahubdb`.* TO 'genix_user'@'localhost';

Sign out:


exit

2. Installing Required Dependencies

1. Install the Python package manager:


sudo apt install -y python3-pip

This command enables Python package management.

2. Install the required Python modules for Seafile:


pip3 install Pillow captcha django-simple-captcha

These modules are required for visual processing and security verification.


3. Downloading the Seafile Package

1. Create the installation directory:


mkdir ~/seafile_home && cd ~/seafile_home

2. Download the Seafile package:


wget https://download.seadrive.org/seafile-server_7.1.4_x86-64.tar.gz

3. Unzip the archive:


tar -zxvf seafile-server_7.1.4_x86-64.tar.gz

4. Enter the installation directory:


cd seafile-server-7.1.4

4. Seafile Configuration

1. Run the configuration script:


bash setup-seafile-mysql.sh

2. Suggested answers:

  1. Server name: Seafile

  2. Domain: ornek.com

  3. Fileserver port: 8082

  4. Database method: Existing databases

  5. DB User: genix_user

  • At the end of the installation, the configuration is completed.

5. Apache Reverse Proxy Settings

1. Enable proxy module:


sudo a2enmod proxy_http

2. Open your SSL Virtual Host file:


sudo nano /etc/apache2/sites-enabled/ornek.com-le-ssl.conf

3. Add the following configuration:


Alias /media /home/sammy/seafile_home/seafile-server-latest/seahub/media

<Location /media>
Require all granted
</Location>

ProxyPass /seafhttp http://127.0.0.1:8082
ProxyPassReverse /seafhttp http://127.0.0.1:8082

RewriteEngine On
RewriteRule ^/seafhttp - [QSA,L]

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
ProxyPass / http://127.0.0.1:8000/
ProxyPassReverse / http://127.0.0.1:8000/

4. Test the configuration:


sudo apache2ctl configtest

5. Restart Apache:


sudo systemctl restart apache2

6. Seafile HTTPS Settings

1. Edit the ccnet.conf file:


nano ~/seafile_home/conf/ccnet.conf

SERVICE_URL = https://ornek.com

2. Open seahub_settings.py:


nano ~/seafile_home/conf/seahub_settings.py

FILE_SERVER_ROOT = 'https://ornek.com/seafhttp'

7. Starting Services


./seafile.sh start
./seahub.sh start
  • An admin account is created on the first run.

1. Log in from browser:


https://ornek.com

8. Autostart with systemd

1. Create the Seafile service:


sudo nano /etc/systemd/system/seafile.service

[Unit]
Description=Seafile
After=network.target mariadb.service

[Service]
Type=forking
ExecStart=/home/sammy/seafile_home/seafile-server-latest/seafile.sh start
ExecStop=/home/sammy/seafile_home/seafile-server-latest/seafile.sh stop
User=sammy
Group=sammy

[Install]
WantedBy=multi-user.target
  • Activate:

sudo systemctl enable seafile

9. Testing File Sync

  • Install desktop or mobile Seafile client
  1. Server address: https://example.com

  2. Sync “My Library” folder

  3. Add files and verify from the web interface

Frequently Asked Questions (FAQ)

1. Why should Seafile be hosted on my own server? Provides data security and full control.

2. Is HTTPS mandatory? Yes, it is essential for security.

3. Is there mobile support? Android and iOS clients available.

Result

With this guide, you have completed the enterprise-level Seafile installation on Ubuntu 20.04. Now you can sync your files safely.

👉 You can start using it immediately on GenixNode.