Nextcloud is a file sharing software similar to Google drive or Dropbox. The difference is you have full control as Nextcloud is open source and the server can be installed on your own machine. In this article, we’ll be installing Nextcloud on an Ubuntu 18.04 Cloud Server.
A Cloud Server running Ubuntu 18.04
Access to the root or admin user
Install LAMP Stack
First thing to do is install and configure the LAMP (Linux Apache Mariadb PHP) stack on your server.
Step 1: Install software
apt install apache2 mariadb-server libapache2-mod-php7.2 unzip apt install php7.2-gd php7.2-json php7.2-mysql php7.2-curl php7.2-mbstring apt install php7.2-intl php-imagick php7.2-xml php7.2-zip
Step 2: MySQL secure installation
It’s a good idea to always run the mysql_secure_installation command right after installing MariaDB or MySQL in order to set a root password, disallow remote root logins, and delete the test databases.
Step 3: Database configuration
Enter your MariaDB installation.
Create a nextcloud database.
CREATE DATABASE nextcloud;
Create a nextcloud user. Make sure to replace
CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY '
Give nextcloud user access to the nextcloud database.
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost';
Now that we have our base LAMP stack set up, we can move on to installing Nextcloud itself.
Step 1: Download and prepare Nextcloud
Change to the document root directory.
Download the latest version of Nextcloud.
Decompress the file.
Remove the compressed file.
Give ownership to the web server.
chown -R www-data:www-data nextcloud/
systemctl restart apache2
Step 2: Install Nextcloud through web browser
In your web browser on your local machine, navigate to http://
Here, you’ll be able to create your admin user and configure database access. As far as the admin account, choose any secure username/password combination. For the database, enter the same credentials we configured earlier in the Database configuration step. It should be nextcloud as the user and database and the password you set.
Nextcloud will then install the base system as well as a few apps you may find useful. Once this is done, you’ll be greeted with the Nextcloud panel and will be ready to upload some files!