{"id":947,"date":"2018-10-19T12:04:44","date_gmt":"2018-10-19T12:04:44","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=947"},"modified":"2018-10-22T23:34:41","modified_gmt":"2018-10-22T23:34:41","slug":"howtoinstallseafileonubuntu1604linuxcloudvpsblog","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/19\/howtoinstallseafileonubuntu1604linuxcloudvpsblog\/","title":{"rendered":"How to Install Seafile on Ubuntu 16.04 \u2022 LinuxCloudVPS Blog"},"content":{"rendered":"<p>19th October 2018<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2018\/10\/How-to-Install-seafile-on-Ubuntu-16.04.jpg\" alt=\"How to Install seafile on Ubuntu 16.04\" width=\"600\" height=\"300\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2018\/10\/installing-seafile-on-ubuntu-16.04.jpg\" alt=\"installing seafile on ubuntu 16.04\" width=\"256\" height=\"64\" \/><\/p>\n<p>SeaFile is an enterprise file hosting platform with high reliability and performance, there are Community Edition and Professional Edition. SeaFile Community Edition is an open source file storage system, it is an alternative to DropBox, we can synchronize the files between multiple computers or mobile devices using the Seafile client. In this tutorial, we will provide you with a step by step instruction on how to install SeaFile Community Edition on Ubuntu 16.04.<\/p>\n<p>Prerequisites:<\/p>\n<ul>\n<li>Ubuntu 16.04 with minimum 2GB of RAM<\/li>\n<li>SSH access with root privileges<\/li>\n<\/ul>\n<h3>1. Log in to your server via SSH:<\/h3>\n<p># ssh root@server_ip<\/p>\n<p>Before starting with the SeaFile installation, it is encouraged to check that our system package database is up to date.<\/p>\n<h3>2. Update the system<\/h3>\n<p># apt update<br \/>\n# apt upgrade<\/p>\n<p>The installation requires a working LAMP, stack. If you don\u2019t have a LAMP stack installed, you need to install it first<\/p>\n<p>#apt install lamp-server^<\/p>\n<h3>3. Install dependencies<\/h3>\n<p>We need to install some dependencies prior to installing SeaFile Community Edition, run the following commands:<\/p>\n<p># apt install python2.7 libpython2.7 python-setuptools python-imaging python-ldap python-mysqldb python-memcache python-urllib3 python-pip<\/p>\n<p>and run<\/p>\n<p># pip install boto<\/p>\n<h3>4. Install SeaFile<\/h3>\n<p>Let\u2019s create a directory to store SeaFile core files.<\/p>\n<p># mkdir \/opt\/seafile<br \/>\n# cd \/opt\/seafile<br \/>\n# wget https:\/\/download.seadrive.org\/seafile-server_6.3.4_x86-64.tar.gz<br \/>\n# tar -xzvf seafile-server_6.3.4_x86-64.tar.gz<br \/>\n# cd \/opt\/seafile\/seafile-server-6.3.4<\/p>\n<p>Let\u2019s create a password for MySQL root user. If your MySQL root user already has a password, you can skip this step<\/p>\n<p># mysql_secure_installation<\/p>\n<p>Now we have configured a password for MySQL root user, let\u2019s proceed with the installation<\/p>\n<p># .\/setup-seafile-mysql.sh<\/p>\n<p>During the installation process, you will be asked for MySQL root password and a new password for Seafile database user.<\/p>\n<p>root@rose:\/opt\/seafile\/seafile-server-6.3.4# .\/setup-seafile-mysql.sh<br \/>\nChecking python on this machine &#8230;<br \/>\nChecking python module: setuptools &#8230; Done.<br \/>\nChecking python module: python-imaging &#8230; Done.<br \/>\nChecking python module: python-mysqldb &#8230; Done.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nThis script will guide you to setup your seafile server using MySQL.<br \/>\nMake sure you have read seafile server manual at<\/p>\n<p>https:\/\/github.com\/haiwen\/seafile\/wiki<\/p>\n<p>Press ENTER to continue<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>What is the name of the server? It will be displayed on the client.<br \/>\n3 &#8211; 15 letters or digits<br \/>\n[ server name ] seafile<\/p>\n<p>What is the ip or domain of the server?<br \/>\nFor example: www.mycompany.com, 192.168.1.101<br \/>\n[ This server&#8217;s ip or domain ] 192.168.0.19<\/p>\n<p>Where do you want to put your seafile data?<br \/>\nPlease use a volume with enough free space<br \/>\n[ default &#8220;\/opt\/seafile\/seafile-data&#8221; ]<\/p>\n<p>Which port do you want to use for the seafile fileserver?<br \/>\n[ default &#8220;8082&#8221; ]<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nPlease choose a way to initialize seafile databases:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>[1] Create new ccnet\/seafile\/seahub databases<br \/>\n[2] Use existing ccnet\/seafile\/seahub databases<\/p>\n<p>[ 1 or 2 ] 1<\/p>\n<p>What is the host of mysql server?<br \/>\n[ default &#8220;localhost&#8221; ]<\/p>\n<p>What is the port of mysql server?<br \/>\n[ default &#8220;3306&#8221; ]<\/p>\n<p>What is the password of the mysql root user?<br \/>\n[ root password ]<\/p>\n<p>verifying password of user root &#8230;<br \/>\nverifying password of user root &#8230; done<\/p>\n<p>Enter the name for mysql user of seafile. It would be created if not exists.<br \/>\n[ default &#8220;seafile&#8221; ]<\/p>\n<p>Enter the password for mysql user &#8220;seafile&#8221;:<br \/>\n[ password for seafile ]<\/p>\n<p>Enter the database name for ccnet-server:<br \/>\n[ default &#8220;ccnet-db&#8221; ]<\/p>\n<p>Enter the database name for seafile-server:<br \/>\n[ default &#8220;seafile-db&#8221; ]<\/p>\n<p>Enter the database name for seahub:<br \/>\n[ default &#8220;seahub-db&#8221; ]<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nThis is your configuration<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>server name: seafile<br \/>\nserver ip\/domain: 192.168.0.19<\/p>\n<p>seafile data dir: \/opt\/seafile\/seafile-data<br \/>\nfileserver port: 8082<\/p>\n<p>database: create new<br \/>\nccnet database: ccnet-db<br \/>\nseafile database: seafile-db<br \/>\nseahub database: seahub-db<br \/>\ndatabase user: seafile<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nPress ENTER to continue, or Ctrl-C to abort<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>Generating ccnet configuration &#8230;<\/p>\n<p>done<br \/>\nSuccessly create configuration dir \/opt\/seafile\/ccnet.<br \/>\nGenerating seafile configuration &#8230;<\/p>\n<p>Done.<br \/>\ndone<br \/>\nGenerating seahub configuration &#8230;<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nNow creating seahub database tables &#8230;<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>creating seafile-server-latest symbolic link &#8230; done<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nYour seafile server configuration has been finished successfully.<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>run seafile server: .\/seafile.sh { start | stop | restart }<br \/>\nrun seahub server: .\/seahub.sh { start | stop | restart }<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nIf you are behind a firewall, remember to allow input\/output of these tcp ports:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>port of seafile fileserver: 8082<br \/>\nport of seahub: 8000<\/p>\n<p>When problems occur, Refer to<\/p>\n<p>https:\/\/github.com\/haiwen\/seafile\/wiki<\/p>\n<p>for information.<\/p>\n<p>Once completed, you can start SeaFile and SeaHub:<\/p>\n<p># .\/seafile.sh start<br \/>\n# .\/seahub.sh start<\/p>\n<p>When starting seahub for the first time, you will be asked for your email address and a password to create a new SeaFile admin<\/p>\n<p>root@rose:\/opt\/seafile\/seafile-server-6.3.4# .\/seahub.sh start<br \/>\nLANG is not set in ENV, set to en_US.UTF-8<br \/>\nLC_ALL is not set in ENV, set to en_US.UTF-8<br \/>\nStarting seahub at port 8000 &#8230;<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nIt&#8217;s the first time you start the seafile server. Now let&#8217;s create the admin account<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>What is the email for the admin account?<br \/>\n[ admin email ] you@yourdomain.com<\/p>\n<p>What is the password for the admin account?<br \/>\n[ admin password ]<\/p>\n<p>Enter the password again:<br \/>\n[ admin password again ]<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nSuccessfully created seafile admin<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Seahub is started<\/p>\n<p>Done.<\/p>\n<p>Now, you can access your new SeaFile installation at http:\/\/YOUR_IP_ADDRESS:8000 or http:\/\/yourdomainname.com:8000<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2018\/10\/install-seafile-ubuntu-16.04.jpg\" alt=\"install seafile ubuntu 16.04\" width=\"563\" height=\"555\" \/><\/p>\n<h3>5. Configure Apache<\/h3>\n<p>To access it without typing the port in the web browser, we need to create an apache virtual host and configure it as a reverse proxy. Apache module proxy_http is not enabled by default, and we need to enable it to run Apache as a reverse proxy.<\/p>\n<p># a2enmod proxy_http<br \/>\n# nano \/etc\/apache2\/sites-available\/yourdomain.com.conf<\/p>\n<p>Add the following lines to the file<\/p>\n<p>&lt;VirtualHost *:80&gt;<br \/>\nServerName yourdomain.com<br \/>\nDocumentRoot \/opt<br \/>\nAlias \/media \/opt\/seafile\/seahub\/media<br \/>\nRewriteEngine On<br \/>\n&lt;Location \/media&gt;<br \/>\nRequire all granted<br \/>\n&lt;\/Location&gt;<\/p>\n<p>ProxyPass \/seafhttp http:\/\/127.0.0.1:8082<br \/>\nProxyPassReverse \/seafhttp http:\/\/127.0.0.1:8082<br \/>\nRewriteRule ^\/seafhttp &#8211; [QSA,L]<\/p>\n<p>SetEnvIf Authorization &#8220;(.*)&#8221; HTTP_AUTHORIZATION=$1<br \/>\nProxyPass \/ http:\/\/127.0.0.1:8000\/<br \/>\nProxyPassReverse \/ http:\/\/127.0.0.1:8000\/<br \/>\n&lt;\/VirtualHost&gt;<\/p>\n<p>Restart apache to apply the configuration changes<\/p>\n<p># systemctl restart apache2<\/p>\n<p>Now, you can access your SeaFile installation at http:\/\/yourdomain.com<\/p>\n<h3>6. Create SystemD file<\/h3>\n<p>In the previous step, we ran seafile and seahub using the provided bash script. Let\u2019s create systemd files to make it easier to manage the application.<\/p>\n<p># nano \/etc\/systemd\/system\/seafile.service<br \/>\n[Unit]<br \/>\nDescription=Seafile hub<br \/>\nAfter=network.target seafile.service<\/p>\n<p>[Service]<br \/>\nType=forking<br \/>\n# change start to start-fastcgi if you want to run fastcgi<br \/>\nExecStart=\/opt\/seafile\/seafile-server-latest\/seahub.sh start<br \/>\nExecStop=\/opt\/seafile\/seafile-server-latest\/seahub.sh stop<br \/>\nUser=www-data<br \/>\nGroup=www-data<\/p>\n<p>[Install]<br \/>\nWantedBy=multi-user.target<\/p>\n<p># nano \/etc\/systemd\/system\/seahub.service<\/p>\n<p>We also need to change the permissions:<\/p>\n<p># chown -R www-data: \/opt\/seafile \/tmp\/seahub_cache<br \/>\nsystemctl daemon-reload<br \/>\nsystemctl restart seafile<br \/>\nsystemctl restart seahub<br \/>\nsystemctl enable seafile<br \/>\nsystemctl enable seahub<\/p>\n<p>If you want to access your SeaFile installation securely, you can install a free certificate from LetsEncrypt. Follow the steps below to enable HTTPS on your website.<\/p>\n<p>apt-get install software-properties-common python-software-properties<br \/>\nadd-apt-repository ppa:certbot\/certbot<br \/>\napt update<br \/>\napt-get install python-certbot-apache<br \/>\ncertbot<\/p>\n<p>In the last command, you will be asked for your email address and the domain name you want to install a certificate to, and whether you want to redirect HTTP to HTTPS or not. Once finished, you can access your SeaFile installation at https:\/\/yourdomain.com<\/p>\n<p>That is it, SeaFile has been successfully installed on your Ubuntu 16.04 server.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2018\/10\/install-seafile-on-ubuntu-16.04.jpg\" alt=\"install seafile on ubuntu 16.04\" width=\"256\" height=\"64\" \/>Of course, you don\u2019t have to Install Seafile on Ubuntu 16.04, if you use one of our <a href=\"https:\/\/www.linuxcloudvps.com\/ubuntu-cloud-vps.html\">Optimized Ubuntu Hosting<\/a> plans, in which case you can simply ask our expert Linux admins to install Seafile on Ubuntu 16.04 for you. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n<p>PS. If you liked this post on How to Install Seafile on Ubuntu 16.04, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n<p>Be the first to write a comment.<\/p>\n<p><a href=\"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-seafile-on-ubuntu-16-04\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>19th October 2018 SeaFile is an enterprise file hosting platform with high reliability and performance, there are Community Edition and Professional Edition. SeaFile Community Edition is an open source file storage system, it is an alternative to DropBox, we can synchronize the files between multiple computers or mobile devices using the Seafile client. In this &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/19\/howtoinstallseafileonubuntu1604linuxcloudvpsblog\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Install Seafile on Ubuntu 16.04 \u2022 LinuxCloudVPS Blog&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-947","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/947","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=947"}],"version-history":[{"count":2,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/947\/revisions"}],"predecessor-version":[{"id":1239,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/947\/revisions\/1239"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}