How To Install Nextcloud In Ubuntu 16.04 LTS

Thanks to: https://www.ostechnix.com/

How To Install Nextcloud In Ubuntu 16.04 LTS

Nextcloud is a free, open source, cross-platform file synchronization and sharing application. It is forked from popular cloud sync tool Owncloud. It allows you to securely sync and share files, folders, contacts, calendar appointments, bookmarks, and emails across multiple devices. It comes with easy to use web-based interface, so that you can access your files using a web browser, from anywhere, from any device, online or offline(Local area network). You can use it either in your home, office, and as well as large enterprises. It simply turns your system into a robust, and secure Cloud platform in minutes. Just store your files in your server, and start accessing them immediately from any devices using Nextcloud / ownCloud Desktop Sync Client, Android app, or iOS app. Nextcloud is available as free and enterprise version, which contains additional features like direct email, phone support from Nextcloud team, audio and video conferencing support, clustering support, migration from Owncloud support, and many. For more details, refer Nextcloud enterprise subscription link.
In this step by step tutorial, we will see how to install Nextcloud and how to use it in real time in Ubuntu 16.04 LTS server edition. Also, we will see how to access Nextcloud from a mobile device.

Install Nextcloud in Ubuntu 16.04 LTS

First things first

First of all, make sure your Ubuntu server is updated to the most recent version.
To do so, run:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
Then, deploy LAMP stack in your Ubuntu server as described in the following link.
Next, make sure you have installed the following php modules and some additional prerequisites:
sudo apt-get install php-gd php-json php-mysql php-curl php-intl php-mcrypt php-imagick php-zip php-dom php7.0-xml php-mbstring wget unzip
Then, We need to tweak some php settings in order to make Nextcloud work properly.
To do so, edit php.ini file:
sudo nano /etc/php/7.0/apache2/php.ini
Find and edit or modify the following values.
[...]

memory_limit = 512M

date.timezone = Asia/Kolkata

upload_max_filesize = 200M

post_max_size = 200M

[...]
Save and close the file. Restart Apache service to take effect the changes.
sudo systemctl restart apache2

Create database for Nextcloud

Next we need to configure a database and database user for Nextcloud. For the purpose of this tutorial, we will create a new database called “ncdb”, database user “ncuser” with password “ubuntu”. I recommend you to use any strong password which is not easy to guess by others.
Log in to mysql prompt using command:
mysql -u root -p
Enter the following commands one by one to create the database, database user:
CREATE DATABASE ncdb;
GRANT ALL PRIVILEGES ON ncdb.* TO 'ncuser'@'localhost' IDENTIFIED BY 'ubuntu';
FLUSH PRIVILEGES;
\q

Download Nextcloud

Head over to the following link and download the latest available Nextcloud version.
Or, Simply use the following command to download it.
wget https://download.nextcloud.com/server/releases/nextcloud-10.0.0.zip
As of writing this guide, the latest version was 10.0.0.
Then, Extract the downloaded zip with command:
unzip nextcloud-10.0.0.zip
Move the extracted folder to your web root directory i.e /var/www/html/ in our case.
sudo cp -r nextcloud/ /var/www/html/
Set the proper ownership permission to the nextcloud directory:
sudo chown -R www-data:www-data /var/www/html/nextcloud/
Next, create a /etc/apache2/sites-available/nextcloud.conf file:
sudo nano /etc/apache2/sites-available/nextcloud.conf
Add the following lines. Replace the path (/var/www/html/nextcloud/) with your own path values.
Alias /nextcloud "/var/www/html/nextcloud/"

<Directory /var/www/html/nextcloud/>
  Options +FollowSymlinks
  AllowOverride All

 <IfModule mod_dav.c>
  Dav off
 </IfModule>

 SetEnv HOME /var/www/html/nextcloud
 SetEnv HTTP_HOME /var/www/html/nextcloud

</Directory>
Save and close the file.
Then create a symlink to /etc/apache2/sites-enabled/ directory using the following command:
sudo ln -s /etc/apache2/sites-available/nextcloud.conf /etc/apache2/sites-enabled/nextcloud.conf
For Nextcloud to work correctly, we need to enable the following Apache modules.
sudo a2enmod rewrite
sudo a2enmod headers
sudo a2enmod env
sudo a2enmod dir
sudo a2enmod mime
Finally, restart Apache service to take effect the changes:
sudo systemctl restart apache2

Start Nextcloud web installer

Open up your web browser and navigate to URL: http://IP_Address/nextcloud or http://domain_name/ nextcloud.
You should see the following screen. Create a new admin account, enter database user name, password, and database name. Finally, click Finish setup button.
nextcloud setup
nextcloud setup
Congratulations! Nextcloud is ready to use.

Comentarios

Entradas populares de este blog

Guía de herramientas básicas para estudiantes: 31 apps y webs imprescindibles para ayudarte con los estudios

Comando FOR para archivos BAT

Policy Based Routing example: route one subnet via ISP A and another via ISP B