How to install Nextcloud 13 on Ubuntu 18.04

To install Next cloud 13 on Ubuntu 18.04

Next cloud is open source software for creating and using file hosting services. It has a lot of extra Calendars, Sync and Contacts feature, apart from their file hosting features. It is a great free alternative to some popular services such as Google Drive, Dropbox, Box, etc

Prerequisites

To install LAMP(Apache, MariaDB, php7)
In MariaDB (create database and user and give privileges to that user )

Php installation with required following modules

add-apt-repository ppa:ondrej/php 
apt-get update 
apt-get install php7.0 php7.0-mysql php7.0-curl php7.0-json php7.0-cgi libapache2-mod-php7.0 php7.0-mcrypt php7.0-xmlrpc php7.0-gd php7.0-mbstring php7.0  php7.0-common  php7.0-xmlrpc php7.0-soap  php7.0-xml php7.0-intl  
php7.0-cli  php7.0-ldap php7.0-zip php7.0-readline php7.0-imap php7.0-tidy php7.0-recode php7.0-sq php7.0-intl

Installation

Download a Next cloud package using this following command

root@linuxhelp1:~# wget https://download.nextcloud.com/server/releases/nextcloud-13.0.2.zip
--2018-05-30 12:13:23--  https://download.nextcloud.com/server/releases/nextcloud-13.0.2.zip
Resolving download.nextcloud.com (download.nextcloud.com)... 88.198.160.133
Connecting to download.nextcloud.com (download.nextcloud.com)|88.198.160.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 61108941 (58M) [application/zip]
Saving to: ‘ nextcloud-13.0.2.zip’ 

nextcloud-13.0.2.zip    100%[==============================> ]  58.28M   935KB/s    in 86s     

2018-05-30 12:14:49 (695 KB/s) - ‘ nextcloud-13.0.2.zip’  saved [61108941/61108941]

The downloaded package is a zip file, so we need to unzip the package now

root@linuxhelp1:~# unzip nextcloud-13.0.2.zip 
Archive:  nextcloud-13.0.2.zip
   creating: nextcloud/
   creating: nextcloud/ocs/
  inflating: nextcloud/ocs/v2.php    
  inflating: nextcloud/ocs/v1.php
.
.
  inflating: nextcloud/resources/config/ca-bundle.crt  
  inflating: nextcloud/resources/config/mimetypealiases.dist.json  
   creating: nextcloud/resources/codesigning/
  inflating: nextcloud/resources/codesigning/root.crt  
  inflating: nextcloud/resources/codesigning/root.crl  
  inflating: nextcloud/resources/codesigning/core.crt

Then move the extracted file into html location

root@linuxhelp1:~# mv nextcloud /var/www/

And then switch to the following directory

root@linuxhelp1:~# cd /var/www/

Change the ownership and permission of the file as follows

root@linuxhelp1:/var/www# chown -R www-data.www-data nextcloud
root@linuxhelp1:/var/www# chmod -R 775 nextcloud/

Create a new virtual host configuration to accessing the Next cloud application

root@linuxhelp1:/var/www# vim /etc/apache2/sites-available/nextcloud.conf
< VirtualHost *:80> 
ServerName www.linuxhelp1.com
DocumentRoot /var/www/nextcloud/

< Directory /var/www/nextcloud/> 
AllowOverride All
allow from all
< /Directory> 

< /VirtualHost> 

Enable the site access

root@linuxhelp1:/var/www# a2ensite nextcloud.conf
Enabling site nextcloud.
To activate the new configuration, you need to run:
systemctl reload apache2

Disable the default access

root@linuxhelp1:/var/www# a2dissite 000-default.conf
Site 000-default disabled.
To activate the new configuration, you need to run:
systemctl reload apache2

Enable the rewrite module

root@linuxhelp1:/var/www# a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
systemctl restart apache2

Then restart the apache2 service

root@linuxhelp1:/var/www# systemctl restart apache2

Now you can proceed the further installation and configuration from the browser by navigating to the following URL: http://< ipaddress or domain name

configure the Admin user credential and Database detail

After configuring you can open the Next cloud application

with this, the method to install Next cloud 13 on Ubuntu 18.04 comes to an end.

FAQ
Q
Can I use an external USB drive with NTFS/FAT filesystem for Nextcloud?
A
No. These do not support the linux user/permission system.

You can read/write to NTFS/FAT filesystems, but the permissions need to be set for the whole drive, which leads to many problems.
Q
Why is my md5sum of the image file different than the md5sum on the site?
A
The md5sum on the site is the md5sum of the tar.bz2 file that you get after you download, not the image's one.
Q
How do I install NextCloudPi on a Raspberry Pi?
A
To install NextCloudPi on a Raspberry Pi Please refer the link as follow "https://github.com/nextcloud/nextcloudpi/wiki/How-to-install-NextCloudPi"
Q
How to install Nextcloud on CentsOS?
A
To install Nextcloud on CentsOSPlease refer the link as follow "https://www.linuxhelp.com/how-to-install-nextcloud-12-03-on-centos-7/"
Q
Do I have to configure every entry in the WebUI and the TUI on Nextcloud?
A
No. You only need to run the Wizard to have a working Nextcloud instance. Everything else is optional.