Nextcloud Part 1

Nextcloud Part 1

One of the most irritating things about working remotely is having to lug a laptop round with you. These days, however, with a modern smartphone or tablet having similar processing power to a low-end computer there’s no reason why work can’t also get done on these devices.  Unfortunately, with most of these mobile devices, storage is often the limitation.

This is where Nextcloud comes in: it provides a system that allows you to synchronize not only your files, but also contacts and calendars between devices.  Also, you would be running it on your own server, keeping you clear of problems such as that recently experienced by Google. They carried out a software update which mistakenly flagged a number of people’s documents as being in breach of Terms and Conditions,  and deleted them from their Docs and Drive service. Nextcloud also provides document editing functionality through a web browser interface, meaning that you really can work on anything wherever you can find an internet connection.

Nextcloud is a web application, so you will need a LAMP stack installed on your VPS to use it. I’ll carry out a whistle stop tour of what you need to install to use it.  On Debian and Ubuntu systems use the following commands to set up the LAMP stack:

sudo apt-get update

sudo apt-get install apache2 mariadb-server 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

During the installation process you’ll be prompted to set a root user password for MariaDB; make sure you remember this as you’ll need it a bit later.

Due to the fact that  we’d strongly recommend you keep your important documents separate from a server that you will host world facing websites on, we’ll configure Nextcloud as the only website on the server.  As such, we’ll be installing it to /var/www/html which is the default location for a website on an Apache server.

Before we can install Nextcloud, we’ll need to create a database and a database user. To do that we’ll log into the MySQL command line:

mysql -u root -p

You will be prompted for the password that you set earlier for MySQL. Once that has been provided, you should be at a command prompt starting with “mysql>”. You’ll need to enter the following commands at this prompt, noting that you need to change ‘mypasswd’ for a secure password that the Nextcloud account can use. Again, you’ll need to remember this password for later:

create database nextcloud CHARACTER SET utf8 COLLATE utf8_bin;

grant all privileges on nextcloud.* to nextcloud@localhost identified by ‘mypasswd’;


Now that your database is ready, let’s get the latest version of Nextcloud, which at the time of writing is version 12.0.3:


First we need to extract the files from the zip archive and move them to the website directory:


cd nextcloud

sudo mv -R * /var/www/html/

Next, we need to change the ownership of the downloaded files to be the user www-data that the Apache web server runs as. This is enable it to save the files you upload to the service to the server. This is done with the following command:

sudo chown -R www-data:www-data /var/www/html

At this point, Nextcloud should be ready to configure on your server. To do that though, there are a few security considerations – such as access through the firewall and adding an SSL certificate to the server  – that we need to take into account, which we will go through next time.

This article was brought to you by, for dedicated server hosting, cloud servers and 24/7 support visit our site here

No Comments

over 200,000 servers launched

and counting worldwide...