How to Install Nextcloud 15 on Ubuntu 18.04

Posted on by Echo Diaz | Updated:
Reading Time: 3 minutes

Similar to Dropbox and Google Drive, Nextcloud is self-hosting software that allows you to share files, contacts, and calendars. But, unlike Dropbox and Google Drive, your files will be private and stored on your server instead of a third-party server. Nextcloud is a GDPR and HIPAA compliant hosting solution, so your files will be encrypted along with the ability to audit. For this tutorial, we’ll be installing our Nextcloud instance on our Ubuntu VPS server.

Pre-flight

Step 1: You’ll first log in to your server.

ssh root@hostname.com

Step 2: Then log in to your MySQL/MariaDB instance by typing:

mysql

You’ll see the prompt change, and you’ll then be able to use MySQL commands to make a database and grant permissions.

MariaDB [(none)]>

Replace the highlighted password below, with a secure password.  You can tell the commands were accepted because it’ll show a “Query OK, 0 rows affected (0.00 sec)” message after each command.  Be sure to have the password for the Nextcloud user handy; we’ll be using it later in this tutorial.

CREATE DATABASE nextcloud;

CREATE USER nextcloud IDENTIFIED BY 'password';

GRANT USAGE ON *.* TO nextcloud@localhost IDENTIFIED BY 'password';

GRANT ALL privileges ON nextcloud.*  TO nextcloud@localhost;

FLUSH PRIVILEGES;

quit;

Install Nextcloud Modules

You’ll need specific modules installed for NextCloud to work, within your terminal, install the modules using the apt install command.  Press Y to continue when prompted.

apt install php-gd php-json php-mysql php-curl php-mbstring

apt install php-intl php-imagick php-xml php-zip

Install NextCloud

Finally, we’ll download and extract NextCloud’s files.  You can then move it over to the destination of your choice, for our tutorial, we’ll move it to our default document root, /var/www/html.

Step 1: Download the Nextcloud package.

wget https://download.nextcloud.com/server/releases/nextcloud-15.0.7.tar.bz2

Step 2: Extract the Nextcloud package.

tar -xvf nextcloud-15.0.7.tar.bz2

Step 3: Move Nextcloud core files over to Apache’s root directories.

cd nextcloud

mv ./* /var/www/html

mv ./.htaccess /var/www/html

mv ./.user.ini /var/www/html

cd /var/www/html

Step 4: Make a directory within the /var/www/html folder for Nextcloud storage.

mkdir /nextcloud-data

Step 5: Nextcloud is run by Apache and uses www-data as the user, therefore, you’ll need to change over the permissions and ownership.

chown -R www-data:www-data ./*

chown -R www-data:www-data .htaccess

chown -R www-data:www-data .user.ini

chown www-data:www-data /nextcloud-data

Step 6: Restart Apache for the changes to take effect.

systemctl restart apache2

Step 7: Verify Nextcloud is working by visiting it in your browser at http://your_ip/index.php.    Creation of the admin account is necessary, as well as setting the folder/directory (nextcloud-data) that NextCloud will store its uploads.

Nextcloud

Note
At this point, it’s a good idea to put encryption on your NextCloud installation.  Though it’s not required adding an SSL on your site protects passwords from being viewed by any 3rd party.
  • Create an Account with username; we are using admin.
  • Data folder should be /nextcloud-data
  • Username and password should be the ones for MySQL that were made earlier, leave the setting on localhost.
  • Click Finish

You are now in Nextcloud and can start uploading files and folders!

Nextcloud interface

Our lightning-fast VPS and Dedicated servers can run Nextcloud. Along with hardware that kicks, you’ll also enjoy 24/7 technical support.  Find out how our supreme hosting services can help you out!

Avatar for Echo Diaz

About the Author: Echo Diaz

Throughout Echo's four year stint as a technical support specialist, her passion for breaking down complex concepts had to lead to a career in professional writing. As a former top tier support specialist, she added a distinctive element to her written work that spoke to customer feedback and concerns. Echo occasionally pops her head out from behind her computer to watch her dog energetically run around the yard and unabashedly shovels money into buying tickets to see her favorite musical artists.

Latest Articles

How to use kill commands in Linux

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change the root password in WebHost Manager (WHM)

Read Article