Like Dropbox and other cloud storage services, Seafile provides similar functions and unlike the other proprietary storage providers, Seafile is free to use. Seafile enables private cloud services on users’ servers. It’s a self-hosted file sync and shares app platforms and with it, you can access & sync your files, contacts, and data across your devices. To get started with installing Seafile, follow the steps below:

Install Nginx HTTP Server on Ubuntu

Nginx HTTP Server is probably the second most popular web server in use. so install it since Seafile needs it. To install Nginx HTTP on the Ubuntu server, run the commands below. After installing Nginx, the commands below can be used to stop, start and enable the Nginx service to always start up with the server boots. To test the Nginx setup, open your browser and browse to the server hostname or IP address and you should see the Nginx default test page as shown below. When you see that, then Nginx is working as expected.

Install MariaDB Database Server

MariaDB database server is a great place to start when looking at open-source database servers to use with Seafile. To install MariaDB run the commands below. After installing MariaDB, the commands below can be used to stop, start and enable the MariaDB service to always start up when the server boots. Run these on Ubuntu 16.04 LTS Run these on Ubuntu 18.04 and 18.10 LTS After that, run the commands below to secure the MariaDB server by creating a root password and disallowing remote root access. When prompted, answer the questions below by following the guide.

Enter current password for root (enter for none): Just press the Enter Set root password? [Y/n]: Y New password: Enter password Re-enter new password: Repeat 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

Next, run the commands below to open the MariaDB default config file… Then add the lines below and save… Restart MariaDB server To test if MariaDB is installed, type the commands below to logon into the MariaDB server Then type the password you created above to sign on. if successful, you should see MariaDB welcome message

Install Seafile Dependencies

Some dependencies must be installed and available for Seafile to function. to get those installed, run the commands below.

Create Seafile Database

Now that you’ve installed all the packages that are required for Seafile to function, continue below to start configuring the servers. First, run the commands below to create a blank Seafile database. To log on to the MariaDB database server, run the commands below. Then create a database called seafiledb, ccnetdb, seahubdb Create a database user called seafileuser with a new password Then grant the user full access to the databases created above. Finally, save your changes and exit.

Download Seafile Latest Release

When you’re ready, run the commands below to download the Seafile installer. At the time of this writing, the latest version is 6.3.4. After that, run the commands below to configure Seafile. Doing that should prompt you to enter the database connection info you created above and set up your environment. You need to add a line in seahub_settings.py to set the value of FILE_SERVER_ROOT. You can also modify FILE_SERVER_ROOT via web UI in “System Admin->Settings”. (Warning: if you set the value both via Web UI and seahub_settings.py, the setting via Web UI will take precedence.) Next, run the commands below to set the correct permissions for Seafile to function.

Configure Nginx

Finally, configure the Apahce2 site configuration file for Seafile. This file will control how users access Seafile content. Run the commands below to create a new configuration file called seafile Then copy and paste the content below into the file and save it. Replace the highlighted line with your domain name and directory root location. Save the file and exit.

Enable the Seafile Site

After configuring the VirtualHost above, enable it by running the commands below Run the commands below to start and stop Seafile inside the Seafile home directory at /var/www/html/seafile. To create a Seafile backend admin account, run the commands below to start seahub. That should prompt you to create a Seafile admin account. Then open your browser and browse to the server domain name. You should see the Seafile login page. Type in the admin account and password created above and log in. That’s it! You can now begin using the Seafile self-storage service. Congratulation! You have successfully installed Seafile on Ubuntu 16.04 | 18.04 and may work on the upcoming 18.10. You may also like the post below: