Install NextCloud with Apache

nextcloud is a suite of client-server software for creating and using file hosting services. It is enterprise ready with comprehensive support options. Being free and open-source software, anyone is allowed to install and operate it on their own private server devices.

Nextcloud is predominantly written in PHP and is accessed on the frontend from a browser. The first step dictates that we install the LAMP server before jumping into anything else. LAMP is an acronym that includes Apache, which is a web server, MySQL or MariaDB database engines, and PHP scripting language.

To install the LAMP stack we shall run the command shown.

Additional PHP modules are mandatory for Nextcloud installation to proceed. They are quite a number, so invoke the command shown

We need to make a few tweaks to the php.ini file which contains the PHP settings or configurations.

Now, restart the Apache webserver for the changes to be applied:


It would also be prudent to confirm that the webserver is up and running as shown.


Create a database for NextCloud

It’s crucial to create a database for Nextcloud’s files and other data that will be saved post-installation. So, access the MariaDB database engine as shown:


Next, proceed and create the database and database user and assign the required privileges as provided in the commands below


 

Save the changes to the database engine


 

Download and configure NextCloud

NextCloud provides various installation methods such as running NextCloud as a virtual machine, or as a docker image. However, we are going to install NextCloud manually.

We are going to grab the latest NextCloud zip file from NextCloud’s official site. At this point, the latest version in NextCloud 23.0.2

 

Once the NextCloud zip file is complete, unzip the file in the /var/www/html path.

 


Thereafter, set the directory permissions to www-data user and group as shown.

 Once that is done, consider setting up the permissions as shown to give the read and execute permissions to the global users.

Create a configuration file for NextCloud

next, we are going to define a configuration file that acts as a virtual host file for nextCloud. So, proceed and create a nextcloud.conf configuration file as follows.

Add the lines shown below. For the ServerName attribute, provide the FQDN of your server or IP address if you don’t have a domain name pointing to your IP.


Save and exit the virtual host config file. Then enable it as follows.


reload the Apache webserver.

At this point, we have concluded all the configurations. To wind up on the NextCloud setup, open your browser and head to the URL indicated.

http://server-IP/nextcloud

You will be required to provide your login and database details as demonstrated in the snippets below.

Post a Comment

Previous Post Next Post