This article will demonstrate how to install Seafile CE on CentOS VPS.
What is Seafile CE?
Seafile Community Edition (CE) is the open-source version of Seafile, a self-hosted file synchronization and collaboration platform. It allows individuals and organizations to set up their own secure, private cloud storage service for file sharing and collaboration.
Seafile is known for its reliability, high performance, and efficient handling of large files and libraries. It competes with other file sync and share services like Dropbox, Google Drive, and Nextcloud but stands out for its focus on file syncing and collaboration features.
Key Features of Seafile CE include:
- File Synchronization: Users can keep files synchronized across different devices, including computers and smartphones, ensuring that they always have access to the latest version of their files.
- Team Collaboration: Seafile CE supports file collaboration through shared libraries. Users can work together on files and folders, with changes synchronized in real-time across all participants’ devices.
- File Versioning: The platform keeps versions of files as they are modified, allowing users to revert to previous versions if needed. This is particularly useful for collaborative projects where tracking changes is essential.
- Encryption: Files stored on Seafile servers can be encrypted, providing an additional layer of security for sensitive information. Encryption occurs before data leaves the client device, ensuring that files are protected during transmission and when stored on the server.
- Fine-grained Permissions: Seafile allows library owners to set detailed permissions for shared folders, controlling who can view, edit, or download files. This makes it suitable for collaborative environments where access control is critical.
- Online File Editing: Through integration with third-party applications like OnlyOffice and Microsoft Office Online, users can edit documents, spreadsheets, and presentations directly in the web browser without the need to download and re-upload files.
- High Performance: Seafile is designed for high performance, particularly in handling large numbers of files and large file sizes. It uses efficient file chunking and deduplication techniques to optimize bandwidth and storage usage.
- Cross-Platform: Seafile clients are available for Windows, macOS, Linux, Android, and iOS, ensuring broad compatibility across devices.
Seafile CE is particularly appealing to businesses and organizations looking for a private and secure way to store, share, and collaborate on files. Its open-source nature allows for customization and integration with existing IT infrastructure, and being self-hosted, it gives organizations full control over their data and privacy.
Pre-requisites
To install Seafile CE on CentOS VPS, the following conditions must be met:
- CentOS VPS (fresh install)
- Root-level access
- 2 Cores
- 2GB RAM or more
- 1GB SWAP or more
- 15GB+ for system
- 100GB+ for Seafile data
How to Install Seafile CE on CentOS VPS
To install Seafile CE on CentOS VPS, follow the steps below:
- Login via SSH as root user.
- Set your server’s FQDN, using the following commands:
hostnamectl set-hostname hostname.yourdomain.com
- Before installing Seafile you’ll need to ensure that your CentOS 8 system is up to date. You can check for any system or software updates and install them using the following commands:
yum check-update yum update -y
- Next, we will need to ensure that the Seafile script will install the latest stable version of MariaDB (at time of writing v10.4). To change the version we will need to create a MariaDB repo file using your preferred editor:
nano /etc/yum.repos.d/MariaDB.repo
- Once you have opened the file you will need to copy and paste the following MariaDB repository information before saving the file:
# MariaDB 10.4 CentOS repository list # http://downloads.mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.4/centos8-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
- Now we can download and execute the Seafile installation script using the wget command and bash:
cd /root wget --no-check-certificate https://raw.githubusercontent.com/haiwen/seafile-server-installer/master/seafile-7.1_centos bash seafile-7.1_centos 7.1.0
- After running the installation script, you’ll need to select option 1 to install Community Edition (CE). Once you have selected the CE edition you will need to wait for the installation to finish.
This script installs the community edition of the Seafile Server on a Centos 8 64bit - Newest Seafile server version, MariaDB, Memcached, NGINX - ----------------------------------------------------------------- This installer is meant to run on a freshly installed machine only. If you run it on a production server things can and probably will go terribly wrong and you will lose valuable data! For questions or suggestions please contact us at support@seafile.com ----------------------------------------------------------------- Possible options: 1 = Seafile Community (Free) Edition (CE) 2 = Seafile Professional Edition (PRO) 1) CE 2) PRO 3) ABORT Which Seafile version would you like to install? 1
- Once the installation script has finished you will see the following message that contains your server address with your admin username and password:
Your Seafile server is installed ----------------------------------------------------------------- Server Address: http://IP_ADDRESS_OR_DOMAIN Seafile Admin: SEAFILE_ADMIN_EMAIL Admin Password: SEAFILE_ADMIN_PASSWORD Seafile Data Dir: /opt/seafile/seafile-data Seafile DB Credentials: Check /opt/seafile.my.cnf Root DB Credentials: Check /root/.my.cnf Switch to Seafile system account with: su - seafile -s /bin/bash This report is also saved to /opt/seafile/aio_seafile-server.log Next you should manually complete the following steps ----------------------------------------------------------------- 1) Log in to Seafile and configure your server domain via the system admin area if applicable. 2) If this server is behind a firewall, you need to ensure that tcp port 80 is open. 3) Seahub tries to send emails via the local server. Install and configure Postfix for this to work or check https://manual.seafile.com/config/sending_email.html for instructions on how to use an existing email account via SMTP. Optional steps ----------------------------------------------------------------- 1) Check seahub_settings.py and customize it to fit your needs. Consult http://manual.seafile.com/config/seahub_settings_py.html for possible switches. 2) Setup NGINX with official SSL certificate, we suggest you use Let’s Encrypt. Check https://manual.seafile.com/deploy/https_with_nginx.html 3) Secure server with iptables based firewall. For instance: UFW or shorewall 4) Harden system with port knocking, fail2ban, etc. 5) Enable unattended installation of security updates. Check https://wiki.Ubuntu.org/UnattendedUpgrades for details. 6) Implement a backup routine for your Seafile server. 7) Update NGINX worker processes to reflect the number of CPU cores. Seafile support options ----------------------------------------------------------------- For free community support visit: https://bbs.seafile.com For paid commercial support visit: https://seafile.com
- That’s it. You have now successfully upgrade MariaDB to version 10.4 and installed Seafile on CentOS 8 VPS using the official auto-installer script.
Securing Seafile CE on CentOS VPS
To secure Seafile CE on CentOS VPS, we will add Nginx security headers and setup LetsEncrypt SSL installation and renewals. Follow the steps below to proceed:
- To add the Nginx HTTP Security Headers we will need to edit the seafile.conf file in the nginx folder using your preferred editor:
nano /etc/nginx/conf.d/seafile.conf
- Once the seafile.conf has opened find the server block, which will start with your server_name and add the following headers below this:
server { server_name hostname.domain.com; add_header X-XSS-Protection "1; mode=block" always; add_header X-Content-Type-Options "nosniff" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload;" always; add_header X-Frame-Options "SAMEORIGIN" always; add_header Referrer-Policy same-origin always; add_header X-Permitted-Cross-Domain-Policies master-only;
- Once complete, save your changes and reload Nginx with the following command:
nginx -s reload
- Now we will setup SSL on Nginx using Let’s Encrypt SSL certificate and enable automatic renewal. Start by installing Certbot with the following commands:
wget https://dl.eff.org/certbot-auto sudo mv certbot-auto /usr/local/bin/certbot-auto sudo chown root /usr/local/bin/certbot-auto sudo chmod 0755 /usr/local/bin/certbot-auto
- Now you will need to request an SSL certificate and edit your Nginx configuration automatically to serve the SSL certificate, turning on HTTPS access in a single step – automagically, using the following command:
sudo /usr/local/bin/certbot-auto --nginx
- Lastly, set up automatic renewals by adding a cron job to the default crontab using the following command:
echo "0 0,12 * * * root python3 -c 'import random; import time; time.sleep(random.random() * 3600)' && /usr/local/bin/certbot-auto renew -q" | sudo tee -a /etc/crontab > /dev/null
Access Seafile CE Dashboard
To access the Seafile CE dashboard, access your server’s hostname or IP address in your browser.
Conclusion
You now know how to install Seafile CE on CentOS VPS servers.
[…] READ ALSO: How to Install Seafile CE on CentOS VPS […]