Installing NextCloud on Ubuntu 18.04 LTS

Introduction

Nextcloud is a free and open-source, self-hosted cloud storage platform that allows you to store, sync, and share files, documents, photos, videos, and other data across different devices and platforms. It is an alternative to commercial cloud storage services like Dropbox, Google Drive, and OneDrive, but with more privacy and control over your data.

Prerequisites


You must following things to complete this tutorial.

  • Ubuntu 22.04 LTS up and running.
  • Root permission.
  • Basic knowledge of linux commands.
  • Internet connecvity.


In this post, We will show you how to install NextCloud on ubuntu 18.04 LTS along with LAMP Stack.

Step 1: Run System Updates

We need to update the ubuntu repository 1st before installation of anything in our ubuntu machine.

sudo apt-get update

Step 2: Installing Apache Web Server

We need to install Apache web server because next cloud is PHP based application we need to web server like apache.

To install apache web server.

sudo apt-get install apache2 -y

To validate apache web server status after installation of the package.

Step 3: Installing PHP

NextCloud based on PHP so that’s why we need to install PHP along with modules, Use the given command to install it.

To install PHP and modules.

sudo apt-get install php php-zip php-xml php-json php-gd libapache2-mod-php php-mysql php-mbstring php-curl -y

To validate the version.

php -v

Step 4: Installing MariaDB Database Server

We also need database in order store user’s details and another user required properties, Use the given command.

To install MariaDB database server.

sudo apt-get install mariadb-server -y

To secure mariadb.

sudo mysql_secure_installation

We need to choose option for MariaDB by your choice, You can use the selection as given below.

set root password? [Y/n] y
Remove anonymous users? [Y/n] y
Disallow root remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

To login MariaDB shell.

sudo mysql -u root -p

Create database and user creds for nextcloud application.

CREATE DATABASE nextcloud;
CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'MYPASSWORD';
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost';
FLUSH PRIVILEGES;
EXIT

Step 5: Downloading NextCloud

Click here to get HTTP address to download the NextCloud zip file, Use the given command for the same.

The given command can download and configure with apache web server, Execute the commands one by one.

cd /tmp
wget https://download.nextcloud.com/server/releases/nextcloud-20.0.5.zip
apt-get install unzip -y
unzip nextcloud-*.zip
rsync -azvh nextcloud/* /var/www/html/
mkdir /var/www/html/data
chown -R www-data:www-data /var/www/html/*
chmod -R ugo+rw /var/www/html/*
systemctl restart apache2

Step 6: Setting up NextCloud

To set up the MariaDB database server and create an administrator account, you must open your browser with the provided URL.

http://IP_Address or http://localhost 

This is your first NextCloud page, where you need to set up your admin username and password in the manner depicted in the screenshot.

On the next step you need to click on Storage & database button to enter the database credentials.

As can be seen, I checked the box next to Install recommended apps and clicked the Finish setup button after entering my MariaDB database credentials.

You will need to update and configure as described in the following step, which will take a few seconds to complete.

After logging in with your admin credentials, you will be shown the NextCloud Open source platform. Click the next icon to move on to the next page.

You can find information about the NextCloud service here. To move on to the next page, simply click the next icon.

Click on the next icon to access official NextCloud information.

Also NextCloud provide App for Desktop, IOS and Android as well.

Here we start using nextcloud.

Conclusion

We have successfully installed and setup the NextCloud service using the LAMP stack on Ubuntu. If you have any questions or issues, please leave a comment below.

Installing NextCloud on Ubuntu 18.04 LTS

Leave a Reply

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

Scroll to top