How to Install Nextcloud on CentOS 8


Easily deploy your favorite applications in seconds at an unbeatable price for your next projects.

Installing Nextcloud on CentOS 8

Nextcloud is a free and open-source cloud storage and collaboration platform that allows you to store your files, documents, and data on your own server or in the cloud. It provides features like file sharing, synchronization, versioning, and collaboration, making it a great alternative to commercial cloud storage services.


  • A fresh CentOS 8 server with root access
  • Minimum 2GB of RAM (recommended)
  • 20GB of free disk space (recommended)

Step 1: Update System Packages

Before installing any software, it's always a good idea to update the system packages to their latest versions:

         $ sudo dnf update

Step 2: Install Required Dependencies

Nextcloud requires a few additional packages to be installed on your system. Use the following command to install them:

         $ sudo dnf install @php @php-cli php-curl php-gd php-intl php-json php-mbstring php-mysqlnd php-opcache php-pdo php-pecl-apcu php-pecl-imagick php-pecl-zip php-xml php-zip

Step 3: Install Apache Web Server

Nextcloud requires a web server to run. In this guide, we'll use Apache. Install Apache using the command below:

         $ sudo dnf install httpd

Step 4: Install MariaDB Database Server

Nextcloud also requires a database server. We'll use MariaDB in this tutorial. Install MariaDB using the following command:

         $ sudo dnf install mariadb-server

Step 5: Secure MariaDB Installation

Secure your MariaDB installation by running the provided security script:

         $ sudo mysql_secure_installation

Step 6: Create a Database for Nextcloud

Create a new database and a dedicated user for Nextcloud:

         $ sudo mysql -u root -p
         mysql> CREATE DATABASE nextcloud;
         mysql> CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'password';
         mysql> GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost';
         mysql> FLUSH PRIVILEGES;
         mysql> EXIT;

Step 7: Download Nextcloud

Download the latest stable release of Nextcloud from their website or use the following command:

         $ cd /tmp
         $ wget https://download.nextcloud.com/server/releases/latest.tar.bz2
         $ tar xvf latest.tar.bz2

Step 8: Move Nextcloud Files

Move the extracted Nextcloud files to the Apache web document root directory:

         $ sudo mv /tmp/nextcloud /var/www/html/

Step 9: Set Permissions

Set the correct permissions for Nextcloud to function properly:

         $ sudo chown -R apache:apache /var/www/html/nextcloud/
         $ sudo chmod -R 755 /var/www/html/nextcloud/

Step 10: Configure Apache

Create a new Apache virtual host configuration file for Nextcloud:

         $ sudo nano /etc/httpd/conf.d/nextcloud.conf

Add the following content to the file:

            ServerName your_domain_or_IP
            DocumentRoot /var/www/html/nextcloud/

               Options +FollowSymlinks
               AllowOverride All
               Require all granted

               Dav off

            SetEnv HOME /var/www/html/nextcloud
            SetEnv HTTP_HOME /var/www/html/nextcloud

Save and close the file.

Step 11: Enable Apache Modules

Enable the required Apache modules:

         $ sudo systemctl enable --now httpd
         $ sudo systemctl restart httpd

Step 12: Access Nextcloud Web Installer

Open your web browser and visit http://your_domain_or_IP/nextcloud/ to start the installation process. Follow the on-screen instructions to complete the installation.

That's it! You have successfully installed Nextcloud on CentOS 8. You can now begin using Nextcloud to store and manage your files and data.

Refer A Friend
Get $25

Installing Nextcloud
CentOS 8
Nextcloud installation
Nextcloud setup
setting up Nextcloud on CentOS 8
Nextcloud installation guide
Nextcloud CentOS tutorial
how to install Nextcloud on CentOS 8
Nextcloud installation step-by-step
Nextcloud CentOS 8 configuration.

Why Customers Love Us

What our customers say about us

Ready To Get Started For Free?

Create your free account today.