How to install Seafile Server on WSL- Windows 10 Subsystem for Linux

Sealfile Server is an open-source self-hosted file sharing solution for private cloud applications software that allows users to create their own personal file cloud storage. In this tutorial, we will learn how to install and use it on Windows 10 WSL- Windows subsystem for Linux.

Those don’t want to store their data on some third party platform, they can create and host personal files on their own Windows 10 or server platforms using Sealfile. Just like Google Drive, One Drive, or DropBox, it is available in Server-client architecture. Thus, we can install the Seafile client application on our smartphone or other computer systems to easily sync data between a Cloud server.

You can consider it as not as an alternative to popular paid platforms such as DropBox but also to other open-source such as NextCloud and OwnCloud platforms. This cross-platform file-sharing software will store the data in a centralized server and that can be accessed via local or internet from anywhere.

Sealfile Server Featrures:

  • Can sync data such as image, files, and more.
  • Supports Windows, Mac, Linux, Android and iOS, and clients.
  • The web-based app interface is supported to manage data
  • Sharing of Files using Public link is possible.
  • Version Control
  • Two-factor authentication for security
  • Users can open and edit documents even the one created using MS-office (docx/pptx/xlsx)
  • Mobile File Access
  • Server-side data encryption
  • Seafile Drive client that can map the private cloud on PC as a virtual drive to access and sync data
  • Users can save Wiki documents in Markdown format directly inside a library
  • Supports file locking to prevent concurrent editing
  • Audit Log helps in monitoring the system
  • File sharing with Permission Control
  • Virus scan for files
  • HTTPS/TLS protocol support

Versions:

The SeaFile is available in two versions, one is standard without any user’s limitations whereas the other one is professional which is also available to download, install, and use free of cost but with only 3 users limitations. Thus, if you are just want to use it for personal or home usage then can go for the Seafile professional server version.

Recommended: Owncloud or NextCloud on WSL.

Steps to install SeaFile File storage Server on Windows 10 -WSL

Here we are using Ubuntu 18.04 LTS focal fossa as the WSL Linux app, however, you can use Ubuntu 20.04 LTS as well. This tutorial can also be followed for any full-fledged supported Ubuntu-based Linux distro including Linux Mint, Elementary OS, and Debian.

Update the system

Run the system command on your Ubuntu WSL app, to confirm all the available packages are up to date.

sudo apt update

Install Seafile Dependencies

This private open-source cloud server requires some tools on the system such as Python3 and more, to perform the smooth installation, thus use the below command to install them:

sudo apt-get install python3 python3-setuptools python3-pip -y
pip3 install Pillow pylibmc captcha jinja2 sqlalchemy
pip3 install django-pylibmc django-simple-captcha python3-ldap

 

Download SeaFile Latest Version

Open the browser on your Windows 10 system and go to the official Download page of this open-source personal cloud server and copy the link as shown in the below screenshot.

Download Seafile personal file storage cloud server for Windows 10 WSL Linux

Now on the Ubuntu 18.04 LTS WSL, type: wget and right-click to paste the copied link. This will look like something this:

wget https://s3.eu-central-1.amazonaws.com/download.seadrive.org/seafile-server_7.1.4_x86-64.tar.gz

Extract file:

tar -xzf seafile-server_*

Create a Separate directory for Seafile

sudo mkdir /opt/seafile/

Move download

sudo mv seafile-server-*/* /opt/seafile

Extract Seafile files min

Install MySQL Server

To store the content of our Personal cloud software, we need to have the MySQL Database. In Case you already have one then you can connect that as well. However, here¬† I am assuming that you don’t have any MySQL instance thus, here we are installing the one.

sudo apt install mysql-server

Once installed start the service

sudo service mysql start

Set MySQL root Password:

mysqladmin -u root password newpass

Note: Change newpass with the password you want o use.

Create Databases for : 

sudo mysql -p

Enter the password you set.

Once login, create Databases:

create database `ccnet_db` character set = 'utf8';

create database `seafile_db` character set = 'utf8';

create database `seahub_db` character set = 'utf8';

User

create user 'seafile'@'localhost' identified by 'seafile';

Give permissions

GRANT ALL PRIVILEGES ON `ccnet_db`.* to `seafile`@localhost;

GRANT ALL PRIVILEGES ON `seafile_db`.* to `seafile`@localhost;

GRANT ALL PRIVILEGES ON `seahub_db`.* to `seafile`@localhost;
exit;

Run the installation script of SeaFile

Switch to Seafile directory and run the below command.

cd /opt/seafile
sudo bash setup-seafile-mysql.sh

Follow the guided installation steps:

  1. Press Enter button
  2. Provide the name which you want to assign to your SeaFile server
  3. Which port the Seafile should use, by default it is 8082. Press the Enter key to go with it, in case this port is being used by some other server enter the one which is free and you want to use.
  4. Select method to use the MySQL server. If you have already a Mysql Database then select 2nd option to connect it otherwise Ist one to create a new entery.

Output For the above script:

h2s@DESKTOP-77FHU5D:/opt/seafile$ sudo bash setup-seafile-mysql.sh
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
https://download.seafile.com/published/seafile-manual/home.md

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 ] h2s

What is the ip or domain of the server?
For example: www.mycompany.com, 192.168.1.101
[ This server's ip or domain ] 192.168.43.45

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 ] 1

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

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

What is the password of the mysql root user?
[ root password ]

verifying password of user root ... done

Enter the name for mysql user of seafile. It would be created if not exists.
[ default "seafile" ]

Enter the password for mysql user "seafile":
[ password for seafile ]

Enter the database name for ccnet-server:
[ default "ccnet-db" ]

Enter the database name for seafile-server:
[ default "seafile-db" ]

Enter the database name for seahub:
[ default "seahub-db" ]

---------------------------------
This is your configuration
---------------------------------

server name: h2s
server ip/domain: 192.168.43.45

seafile data dir: /opt/seafile-data
fileserver port: 8082

database: create new
ccnet database: ccnet-db
seafile database: seafile-db
seahub database: seahub-db
database user: seafile
---------------------------------
Press ENTER to continue, or Ctrl-C to abort
---------------------------------
Generating ccnet configuration ...
done
Successly create configuration dir /opt/ccnet.
Generating seafile configuration ...
Done.
done
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: ./seafile.sh { start | stop | restart }
run seahub server: ./seahub.sh { 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
https://download.seafile.com/published/seafile-manual/home.md
for information.

The installation is done. One more thing, if you are using a firewall then remember to open the following ports.

cnet server: 10001

seafile server: 12001

httpsserver: 8082

seahub: 8000

Run Seafile server and create Seahub Admin account

To start the Seafile Server and Seahub Website run the scripts available for them in the folder we have created under /opt/seafile.

cd /opt/seafile
sudo bash seafile.sh start
sudo bash seahub.sh start

———-Script ask you to create Admin account here———

For more information see the official docs…

Open browser: 127.0.01:8000

Login SeaFile

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.