Learn how to install Nextcloud Server on CentOS 8 with this comprehensive step-by-step guide, enabling private cloud storage and collaboration for your organization. #centlinux #linux #nextcloud
Table of Contents
What is Nextcloud?
Nextcloud is a powerful, open-source software platform designed for creating and managing private cloud storage and collaboration environments. It allows individuals and organizations to host their own secure cloud servers, providing capabilities similar to those of commercial services like Google Drive, Dropbox, and Microsoft OneDrive.
Key features of Nextcloud include:
- File Storage and Sharing: Users can store, share, and access files from anywhere, on any device.
- Collaboration Tools: Includes integrated tools for document editing, calendar management, and communication, supporting seamless collaboration among team members.
- Security and Privacy: Offers robust security features such as end-to-end encryption, two-factor authentication, and detailed access controls, ensuring that data remains private and secure.
- Customizability: Highly customizable with a wide range of apps and extensions available to extend its functionality.
- Self-Hosting: Allows users to host their data on their own servers, giving them complete control over their data and infrastructure.
- GDPR Compliance: Helps organizations comply with data protection regulations like GDPR.
Nextcloud is ideal for businesses, educational institutions, and individuals who need a reliable, secure, and flexible cloud storage solution without relying on third-party providers.

Filecloud vs Nextcloud
FileCloud and Nextcloud are both popular self-hosted cloud storage and collaboration solutions, but they have different features and strengths. Here’s a comparison to help you understand the differences:
FileCloud
Enterprise Focus
- Designed with enterprise needs in mind, offering extensive features for businesses.
- Includes advanced data governance, compliance, and data leak prevention (DLP) capabilities.
Security and Compliance
- Provides robust security features including two-factor authentication, ransomware protection, and GDPR compliance.
- Offers data residency options, allowing businesses to choose where their data is stored geographically.
File Management
- Supports extensive file-sharing options, including sharing via links with expiration dates and download limits.
- Includes endpoint backup, allowing users to back up their devices to the cloud.
Customization and Branding
- Allows extensive customization and branding, making it suitable for businesses wanting a consistent look and feel.
- Offers a white-label option, enabling organizations to rebrand the platform entirely.
Integration
- Integrates well with various enterprise systems such as Active Directory, LDAP, and SIEM systems.
- Supports integration with other storage solutions like Amazon S3 and Azure Blob Storage.
Nextcloud
Open-Source and Community-Driven
- Open-source platform with a large community of contributors and users.
- Users can freely modify and extend the software, benefiting from a wide range of community-developed apps.
Collaboration Tools
- Includes built-in collaboration tools such as Nextcloud Talk for communication, and OnlyOffice or Collabora Online for document editing.
- Offers features like calendar, contacts, and task management, making it a comprehensive productivity suite.
Security and Privacy
- Focuses on security and privacy with features like end-to-end encryption, two-factor authentication, and access control.
- Gives users full control over their data, with the ability to self-host and decide where their data is stored.
Flexibility and Customization
- Highly customizable with a wide range of apps available to extend its functionality.
- Suitable for both personal use and organizational needs due to its flexibility.
Integration
- Integrates with various external services and platforms, including popular cloud storage providers and email servers.
- Supports federation, allowing different Nextcloud instances to connect and share data seamlessly.
Summary
- FileCloud is ideal for enterprises looking for a robust, compliant, and customizable cloud storage solution with strong emphasis on data governance and security.
- Nextcloud is perfect for users who value open-source flexibility, a rich set of collaboration tools, and full control over their data and server environment.
Choosing between FileCloud and Nextcloud depends on your specific needs regarding customization, compliance, integration, and the level of control you require over your data. However, if your top priority is end-to-end encryption and effortless file security, NordLocker is a perfect choice. It ensures your sensitive files remain private, even if your cloud provider is compromised.
Nextcloud System Requirements
Minimum system requirements for Nextcloud server are:
- Memory – 512MB
- Operating System – CentOS 8
- Database – MariaDB 10.2 or later
- Web Server – Apache 2.4 or Nginx
- PHP Runtime – 7.2 or later
A complete list of recommended software for Nextcloud is available on their website.
🌟 Take Control of Your Data Today! Are you tired of relying on public cloud services that compromise your privacy? With Nextcloud hosting, you get complete control, secure storage, and seamless collaboration for your team. Imagine accessing your files anytime, anywhere, with blazing-fast performance and rock-solid security. Don’t wait—every day you delay is another day your data is at risk.
Join hundreds of businesses already protecting their data and experience worry-free cloud hosting now!
Linux Server Specification
We are using a minimal CentOS 8 virtual machine with following specification.
- CPU – 3.4 Ghz (1 cores)
- Memory – 1 GB
- Storage – 40 GB
- Operating System – CentOS Linux 8.2
- Hostname – nextcloud-01.centlinux.com
- IP Address – 192.168.116.206 /24
For setting up Nextcloud Server on CentOS 8, it’s important to have a reliable and efficient environment that supports your testing and production needs. Many users find that using a compact Mini PC or a VPS like Hostinger’s VPS hosting offers an ideal balance of performance and flexibility.
A Mini PC provides a dedicated physical machine for hands-on Linux server experimentation without the space and power consumption of a full desktop.
[Limited Time Mini PC Offers – Click and Save!]
While a Hostinger VPS delivers scalable cloud resources accessible from anywhere. Both options enable you to deploy, configure, and troubleshoot Nextcloud seamlessly in a controlled environment before moving to production.
[Power Your Projects with Hostinger VPS – Join Here!]
Disclaimer: Some of the links in this guide are affiliate links, meaning at no extra cost to you, I may earn a small commission if you decide to purchase through these links. This helps support the blog and allows me to continue creating helpful Linux tutorials. Thank you for your support!
Update your Linux Server
Connect with nextcloud-01.centlinux.com as root user by using a SSH client such as PuTTY.
Use dnf command to update software packages on your Linux operating system.
dnf update -yInstall MariaDB Server on CentOS 8
Nextcloud software requires a back-end database server to create its data repository.
SQLite is the default database for Nextcloud server, which is good for test environments.
Nextcloud also supports MySQL, MariaDB, Oracle 11g and PostgreSQL databases. But MySQL/MariaDB are the recommended databases for Next Cloud in production environments.
Therefore, you should install MariaDB server on your Linux operating system.
dnf install -y mariadb-serverEnable and start MariaDB service by executing systemctl command.
systemctl enable --now mariadb.serviceConfigure MySQL server and set a strong password for root user.
mysql_secure_installationOutput:
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] Y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] Y
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] Y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] Y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
Install Nginx Server on CentOS 8
Nextcloud is a PHP based web application, therefore, it requires a LAMP on LEMP server for deployment.
As per documentation use of Apache web server is recommended. However, Nextcloud also supports Nginx web server and we are using the same in this installation guide.
dnf install nginx -yEnable and start Nginx service by executing the systemctl command.
systemctl enable --now nginx.serviceAllow Nginx service to be accessible across the network by allowing the relevant service ports in Linux firewall.
firewall-cmd --permanent --add-service=http
firewall-cmd --reloadTo verify that Nginx web server is accessible, open the URL http://nextcloud-01.centlinux.com in a web browser.

Install PHP on CentOS 8
Finally, you have to install PHP on your Linux server and integrate it with Nginx web server to form the LEMP stack.
We have list down all the required PHP extensions and we are installing all of them with a single dnf command.
yum install php php-mysqlnd php-fpm php-opcache php-gd php-xml php-mbstring php-common php-json php-curl php-zip php-bz2 php-intl -yConfigure PHP settings for integration with Nginx web server.
vi /etc/php-fpm.d/www.confLocate following parameters.
user = apache
group = apacheand replace with following parameters.
user = nginx
group = nginxSet following SELinux boolean to allow Nginx web server to execute external programs.
setsebool -P httpd_execmem 1Enable and start php-fpm.service by using systemctl command.
systemctl enable --now php-fpm.serviceTo Apply PHP configurations to your Nginx web server, you need to restart it.
systemctl restart nginx.serviceCreate a sample PHP page with famous phpinfo() function, to verify the PHP support and check the installed modules.
vi /usr/share/nginx/html/info.phpAdd following PHP code therein.
<?php phpinfo(); ?>Open URL https://nextcloud-01.centlinux.com/info.php in a web browser.

Your LEMP server has been configured successfully.
Install Nextcloud Server on CentOS 8
Nextcloud is free and open source, therefore you can easily download Nextcloud from their official website.

Currently, Nextcloud 19 is available for download at their website.
Copy link location of Download Nextcloud button. You will use this URL to download the Nextcloud software from the Linux CLI.
Change directory to /tmp and use the copied URL with wget to download Nextcloud 19 installation archive.
cd /tmp
wget https://Nextclouddownload.nextcloud.com/server/releases/nextcloud-19.0.0.zipThe downloaded Nextcloud software is in zip format, therefore, you require unzip utility to extract the contents of downloaded file.
If unzip is not already installed on your Linux server, then you can easily install it by executing dnf command.
dnf install unzip -yExtract the contents of downloaded file by using unzip command.
unzip nextcloud-19.0.0.zip -d /usr/share/nginx/We have used -d switch to extract the zip file directly into default document root directory of our Nginx web server.
Configure SELinux and File Permissions
Adjust the file permission on Nextcloud server software.
chown -R nginx:nginx /usr/share/nginx/nextcloudYou are also required to adjust owner-group of following PHP directories.
chgrp -R nginx /var/lib/php/{opcache,session,wsdlcache}Since, you are installing Nextcloud with SELinux in enforcing mode. Therefore, you need to add a custom “File Context” of the Nextcloud software directory in SELinux policies.
For this purpose, you can use semanage command. If semanage command is not available in your CentOS / RHEL 8 machine, then you have to install policycoreutils-python-utils package by using Linux package manager.
semanage fcontext -a -t httpd_sys_rw_content_t '/usr/share/nginx/nextcloud(/.*)?'Apply the newly added file context on the Nexcloud directory by using restorecon command.
restorecon -R /usr/share/nginx/nextcloudCreate MariaDB Database
Connect to MariaDB database server as root user.
mysql -u root -pCreate a MySQL database for Nextcloud server as follows.
CREATE DATABASE nextcloud DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;Create a user to own nextcloud database.
CREATE USER ncuser@localhost IDENTIFIED BY 'Centlinux@123';Grant all privileges on nextcloud database to ncuser.
GRANT ALL PRIVILEGES ON nextcloud.* TO ncuser@localhost;Reload privileges tables.
FLUSH PRIVILEGES;Exit from MariaDB shell.
EXITConfigure Nginx for Nextcloud Server
Edit /etc/nginx/nginx.conf configuration file.
vi /etc/nginx/nginx.confSearch and set following directive in this file.
server_name nextcloud-01.centlinux.com;
root /usr/share/nginx/nextcloud/;Restart Nginx service to apply changes.
systemctl restart nginx.serviceCreate a data directory for Nextcloud server. This directory is very important because it will hold all the files uploaded by using web interface.
mkdir /usr/share/nginx/nextcloud/dataSet nginx user as owner of this directory.
chown -R nginx:nginx /usr/share/nginx/nextcloud/dataCreate a SELinux File Context for this directory. So, the nginx user can write on this directory.
semanage fcontext -a -t httpd_sys_rw_content_t '/usr/share/nginx/nextcloud/data(/.*)?'Apply the newly added file context on data directory.
restorecon -R /usr/share/nginx/nextcloud/data/Access Nextcloud web application by opening URL http://nextcloud-01.centlinux.com in a web browser.

You will be asked to
- create an Admin user for Nextcloud
- location of data directory
- credentials to access Nextcloud database
You can enter the required information.

Click on “Finish Setup” and you will be routed to “Nextcloud Hub”.
By default, we have been logged in as Admin user. You can now use Nextcloud web interface to upload your files.
Read Also: How to install ownCloud on RHEL 8
Final Thoughts
Setting up a Nextcloud server on CentOS 8 is a fantastic way to ensure secure, private cloud storage and collaboration for your organization. By following the steps in this guide, you’ll have a robust and flexible cloud solution tailored to your needs.
Optimize your cloud infrastructure and secure your servers with my AWS and Linux administration services. Let’s ensure your systems run smoothly. Connect with me now! if you need any guidance or advice related to your Linux VPS.
Thank you for reading, and I look forward to helping you create your private cloud!
FAQs
Q1: Can I use Nextcloud on CentOS 8 without a web server like Apache or Nginx?
Nextcloud requires a web server such as Apache or Nginx to run since it serves web pages and API endpoints.
Q2: Is it safe to install Nextcloud on a CentOS 8 minimal installation?
Yes, but you must manually install all required dependencies like PHP, MariaDB, and a web server for full functionality.
Q3: Can I enable HTTPS for Nextcloud on CentOS 8 without a domain name?
Yes, you can use a self-signed SSL certificate for HTTPS, but browsers will warn that the connection is not trusted.
Q4: How much storage space should I allocate for a Nextcloud server on CentOS 8?
It depends on your expected usage, but starting with at least 20 GB is recommended for personal use and small team setups.
Q5: Can I run Nextcloud behind a firewall on CentOS 8?
Yes, but you must allow HTTP (port 80) and HTTPS (port 443) through the firewall for Nextcloud to function properly.
Recommended Courses
If you are preparing for the [NEW] Ultimate AWS Certified Cloud Practitioner CLF-C02 2025 exam, then Stephane Maarek’s top-rated online course is one of the best investments you can make. Known for his clear teaching style and real-world cloud expertise, Stephane has helped thousands of students pass AWS certifications with confidence.
This updated course covers everything you need to know for the 2025 exam version, including hands-on examples, exam tips, and detailed explanations that simplify even the toughest concepts. Don’t just study—prepare smartly with a course that gives you the edge.
Disclaimer: Some of the links in this post are affiliate links, meaning I may earn a commission if you click through and make a purchase—at no additional cost to you.

Leave a Reply
Please log in to post a comment.