Install Nextcloud 12.0 on Ubuntu 17.04

Nextcloud is a powerful, rich features file sharing server. Its more like dropbox which provides storage and file sharing over the internet. Nexcloud was developed alongside Owncloud, both are awesome project. The new version of Nextcloud 12.0 is available. There are many updates and improvements have been made to this new version.

Steps to install Nextcloud 12.0 on Ubuntu 17.04

Step 1. Install LAMP Stack

Nextcloud run on top a working web server. You can either use Nginx or Apache. On this tutorial, I am using Apache web server. You may read how to install LAMP Stack on Ubuntu 17.04 server. After that, please install the following packages required by Nextcloud.

sudo apt-get install libapache2-mod-php7.0 php7.0-gd php7.0-json php7.0-mysql php7.0-curl php7.0-mbstring php7.0-intl php7.0-mcrypt php-imagick php7.0-xml php7.0-zip

Step 2. Create new Database and user

#log in to MySQL Console
mysql -u root -p

#create new database
CREATE DATABASE nextcloud;

#create new user
CREATE USER 'dhani'@'localhost' IDENTIFIED BY '12345';

#add privilege to the new user
GRANT ALL PRIVILEGES ON nextcloud.* TO 'dhani'@'localhost' IDENTIFIED BY '12345';

#flush privileges
FLUSH PRIVILEGES;

#exit
EXIT;

Please modify the database name, user and password with your own.

Step 3. Download Nextcloud 12 package

cd /tmp
wget https://download.nextcloud.com/server/releases/nextcloud-12.0.0.zip

Extract the package

unzip nextcloud-12.0.0.zip

Now copy the nextcloud folder content to /var/www/html/

sudo cp -R nextcloud/* /var/www/html/
sudo chown -R www-data:www-data /var/www/html/

Step 4. Configure Apache web server

Create nextcloud apache configuration file

sudo nano /etc/apache2/sites-available/nextcloud.conf

Paste the following lines to it

Alias /nextcloud "/var/www/nextcloud/"

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

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

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

</Directory>

Create symlink

sudo ln -s /etc/apache2/sites-available/nextcloud.conf /etc/apache2/sites-enabled/nextcloud.conf

Enable module

sudo a2enmod rewrite
sudo a2enmod headers
sudo a2enmod env
sudo a2enmod dir
sudo a2enmod mime

Reload Apache

sudo systemctl reload apache2

Step 5. Configure Nextcloud via Web browser

Open web browser from other computer and type the Ubuntu server IP address. You will see the following window opened. We need to enter the information needed such as database name, user and password.

This slideshow requires JavaScript.

Thank you.

Admin

Leave a Reply

Your email address will not be published. Required fields are marked *