How to Install Nextcloud on CentOS 7: Step‑by‑Step Guide
This guide walks you through installing and configuring Nextcloud on CentOS 7, covering dependencies, Apache, MariaDB, PHP, Nextcloud deployment, virtual‑host setup, and final login verification, enabling a fully functional private cloud storage service.
Introduction
Nextcloud is an open‑source private‑cloud storage solution that provides cross‑platform file sync, sharing, version control and team collaboration, with clients for Windows, macOS, Android, iOS, Linux, a web interface and WebDAV support.
Installation Environment
Operating system: CentOS 7.x. Required components: Apache, MariaDB, PHP.
1. Install Dependencies
yum install -y epel-release yum-utils unzip curl wget bash-completion policycoreutils-python mlocate bzip2
yum update -y2. Install Apache
yum install -y httpd
systemctl enable httpd.service
systemctl start httpd.service3. Install MariaDB
yum install -y mariadb-server
systemctl start mariadb
systemctl enable mariadb
mysqladmin -u root password 'pwd123'4. Install PHP
# Remove old PHP versions
yum remove php* php-common
# Add Webtatic repository
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
# Install PHP 7.2 packages
yum install -y php72w php72w-cli php72w-common php72w-curl php72w-gd php72w-mbstring php72w-mysqlnd php72w-process php72w-xml php72w-zip php72w-opcache php72w-pecl-apcu php72w-intl php72w-pecl-redis
systemctl restart httpdIf PHP 7 fails to parse files, run yum -y install php* --skip-broken and retry the installation commands.
5. Install Nextcloud
cd /var/www/html/
wget https://download.nextcloud.com/server/releases/nextcloud-15.0.0.zip
yum -y install wget unzip
unzip nextcloud-15.0.0.zip
chown -R apache:apache /var/www/html/nextcloud
chmod -R 775 /var/www/html/nextcloud6. Configure Apache Virtual Host
vim /etc/httpd/conf.d/vhost.conf
# Add:
<VirtualHost *:80>
DocumentRoot "/var/www/html"
ServerName cloud.magedu.com
ServerAlias cloud.magedu.com
<Directory "/var/www/html/">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
systemctl restart httpd7. Configure Nextcloud
Remember the admin username and password; the data directory can stay default. Set the database user/password as needed; the database name can be arbitrary because Nextcloud will create it automatically. If the database runs on the same VPS, use localhost:3306 as the URL.
8. Verify Login
Source: https://www.qcmoke.site/tools/nextcload.html
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
