![]() |
VOOZH | about |
We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.
Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.
Follow TNS on your favorite social media networks.
Become a TNS follower on LinkedIn.
Check out the latest featured and trending stories while you wait for your first TNS newsletter.
The open source cloud storage system Seafile could easily serve as your in-house cloud platform. Written with the Python Django framework, Seafile is powerful, includes a user-friendly web frontend, and offers features like:
Seafile is used by the likes of Kaspersky, Humboldt University, Gutenberg University, University of Strasbourg, and more, and with over 1 million users and thousands of teams, Seafile is ready to become your go-to, on-premise cloud solution.
I want to walk you through the process of installing the Seafile cloud storage server on Linux. I’ll be demonstrating on Ubuntu Server 18.04.
The first thing to do is download the Seafile server with the command:
wget https://s3.eu-central-1.amazonaws.com/download.seadrive.org/seafile-server_7.1.4_x86-64.tar.gz
Make sure to check the official Seafile download page, so that you’re downloading the latest version of the server.
Once the file downloads, unpack it with the command:
tar xvfz seafile-server_7.1.4_x86-64.tar.gz
This will create a new directory, named seafile-server-7.1.4. Change into that directory with the command:
cd seafile-server-7.1.4
Create a new directory to house Seafile with the command:
sudo mkdir /srv/seafile
Move the entire contents of the directory with the command:
sudo mv * /srv/seafile/
Seafile depends on a database server, so let’s install it with the command:
sudo apt-get install mysql-server -y
Install the remaining dependencies with the commands:
sudo apt install python python-{pip,pil,ldap,urllib3,setuptools,mysqldb,memcache,requests} -y
sudo apt install libpython3.6 ffmpeg python3-django-captcha -y
When that installation completes, secure the MySQL database server with the command:
sudo mysql_secure_installation
Make sure to give the database admin user a strong password and answer Y for the remaining questions.
It’s time to create the Seafile databases. Log in to the MySQL console with the command:
sudo mysql -u root -p
Create the necessary databases and grant the necessary permissions with the commands:
CREATE DATABASE seafile_server; CREATE DATABASE ccnet_server; CREATE DATABASE seahub_server; CREATE USER 'seafile'@'localhost' IDENTIFIED BY 'PASSWORD'; GRANT ALL ON seafile_server.* TO 'seafile'@'localhost'; GRANT ALL ON ccnet_server.* TO 'seafile'@'localhost'; GRANT ALL ON seahub_server.* TO 'seafile'@'localhost'; QUIT;
…where PASSWORD is a strong/unique password.
With everything out of the way, it’s time to configure Seafile. To do this, change into the /srv/seafile directory with the command:
cd /srv/seafile
Issue the command:
sudo ./setup-seafile-mysql.sh
When prompted, hit Enter on your keyboard and the installation will begin. You will be asked a number of questions (such as server name, server address, server port, etc.). When asked about initializing the databases, type 1 to create new. You will then be asked questions regarding the database server. Those questions (and answers) are:
Where PASSWORD is a strong/unique password.
That’s it for the configuration.
Now that Seafile is configured, it’s time to run the server. To do this, you must start two components: seafile and seahub. To start these components, remain in the /opt/cloud directory and issue the following commands:
sudo ./seafile.sh start
sudo ./seahub.sh start
When you run the seahub.sh script for the first time, you’ll be asked to set up a new admin user (you’ll enter an email address and password for that user).
We’ll use NGINX as our web server, which will need to be configured as a reverse proxy. Install the server with the command:
sudo apt-get install nginx -y
Once NGINX is installed, start and enable it with the commands:
sudo systemctl start nginx
sudo systemctl enable nginx
Create a new configuration file with the command:
sudo nano /etc/nginx/conf.d/seafile.conf
In that file, paste the following:
server {
listen 80;
listen [::]:80;
server_name SERVERADDRESS;
autoindex off;
client_max_body_size 100M;
access_log /var/log/nginx/seafile.com.access.log;
error_log /var/log/nginx/seafile.com.error.log;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_read_timeout 1200s;
}
location /seafhttp {
rewrite ^/seafhttp(.*)$ $1 break;
proxy_pass http://127.0.0.1:8082;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 36000s;
proxy_read_timeout 36000s;
proxy_send_timeout 36000s;
send_timeout 36000s;
}
location /media {
root /srv/seafile-server-latest/seahub;
}
}
Where SERVERADDRESS is either the domain or IP address of the hosting server.
Save and close the file. Restart NGINX with the command:
sudo systemctl restart nginx
You can now access your newly-installed Seafile platform. Open a web browser and point it to http://SERVER_IP (Where SERVER_IP is either the domain or IP address of the hosting server). You will be prompted to log in (Figure A).
Use the email/password credentials you created after running the ./seahub.sh start script and you’ll find yourself on the main Seafile page, where you can start working with your on-premise cloud platform.
Tutorial: Deploy a Highly Availability GlusterFS Storage Cluster
Tutorial: Create a Docker Swarm with Persistent Storage Using GlusterFS
Tutorial: Dynamic Provisioning of Persistent Storage in Kubernetes with MiniKube