How to Install Nextcloud on Manjaro

In this tutorial, we will guide you step-by-step on how to install Nextcloud on your Manjaro system.

Nextcloud is a powerful open-source software that allows you to store, access, and share your files, documents, and other data securely. It is an efficient, user-friendly platform that enables you to collaborate and communicate with your team and clients easily.

Step 1 - Installing Apache Server

The first step is to install the Apache web server. You can do this by opening the terminal and typing the following command:

sudo pacman -S apache

This command will start the installation of the Apache web server on your Manjaro system.

Step 2 - Installing PHP

Next, we need to install PHP (hypertext preprocessor). PHP is a popular scripting language that is used to run web applications on the server-side. You can install PHP by typing the following command in the terminal:

sudo pacman -S php php-apache

This command will install the latest version of PHP on your system along with the Apache module.

Step 3 - Installing MariaDB

Nextcloud requires a database to store its data, and MariaDB is a popular choice for that. You can install MariaDB by typing the following command:

sudo pacman -S mariadb

This command will install the MariaDB database on your system.

Step 4 - Installing Nextcloud

Now, it's time to download and install Nextcloud. You can download the latest version of Nextcloud from the official website: https://nextcloud.com/install/#instructions-server.

After downloading the archive, extract it and move the entire folder to the Apache web server's DocumentRoot. By default, the DocumentRoot for the Apache server is /srv/http/.

Run the following command to extract the archive:

tar -xvf nextcloud-x.x.x.tar.bz2

Then, move the folder to the Apache DocumentRoot:

sudo mv nextcloud /srv/http/

Step 5 - Configuring MariaDB

Next, we need to create a database for Nextcloud on MariaDB. You can do this by typing the following command:

sudo mysql -u root -p

This command will open the MariaDB shell. After that, run the following commands to create a new database and user:

CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost' IDENTIFIED BY 'your-password';

FLUSH PRIVILEGES;

EXIT;

Make sure to replace 'your-password' with a secure password.

Step 6 - Configuring Nextcloud

Next, we need to configure Nextcloud to connect to the MariaDB database. To do this, open the config.php file in the Nextcloud folder:

sudo nano /srv/http/nextcloud/config/config.php

Then, add the following lines at the end of the file:

'dbtype' => 'mysql',

'dbname' => 'nextcloud',

'dbuser' => 'nextclouduser',

'dbpassword' => 'your-password',

'dbhost' => 'localhost',

'overwrite.cli.url' => 'http://localhost/nextcloud',

Again, make sure to replace 'your-password' with the password you set earlier.

Step 7 - Setting File Permissions

Finally, we need to set the correct file permissions for the Nextcloud folder. You can do this by running the following commands:

sudo chown -R http:http /srv/http/nextcloud

sudo chmod -R 755 /srv/http/nextcloud

These commands will change the ownership to http and set the correct permissions for the files and folders.

Step 8 - Starting Apache and MariaDB

Now, we can start the Apache web server and MariaDB. You can do this by running the following commands:

sudo systemctl start httpd

sudo systemctl start mariadb

Step 9 - Accessing Nextcloud

Finally, open your web browser and go to http://localhost/nextcloud. You should see the Nextcloud setup page.

Follow the instructions on the page to complete the setup process.

Congratulations! You have successfully installed Nextcloud on your Manjaro system. Now you can store, access, and share your files securely.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!