How to Install ownCloud on CentOS Stream 10 with PHP 7.4

This guide covers installing ownCloud on CentOS Stream 10 while maintaining PHP 7.4 compatibility. Note that this version of ownCloud is not compatible with PHP 8.0.

Update System

dnf update -y

Output:

[root@vps ~]# dnf update -y
CentOS Stream 10 - BaseOS                       2.1 MB/s | 6.6 MB     00:03
CentOS Stream 10 - AppStream                    261 kB/s | 3.1 MB     00:12
CentOS Stream 10 - Extras packages              9.5 kB/s | 3.8 kB     00:00
Dependencies resolved.
================================================================================
 Package                      Arch   Version                    Repo       Size
================================================================================
Installing:
 kernel                       x86_64 6.12.0-58.el10             baseos     16 k
Upgrading:
 NetworkManager               x86_64 1:1.51.90-2.el10           baseos    2.2 M
 NetworkManager-libnm         x86_64 1:1.51.90-2.el10           baseos    1.9 M
 NetworkManager-tui           x86_64 1:1.51.90-2.el10           baseos    231 k
 amd-gpu-firmware             noarch 20250212-14.el10           appstream  27 M
 amd-ucode-firmware           noarch 20250212-14.el10           baseos    307 k
 atheros-firmware             noarch 20250212-14.el10           baseos     37 M
 bash                         x86_64 5.2.26-6.el10              baseos    1.8 M
 binutils                     x86_64 2.41-52.el10               baseos    6.2 M

Install Required Dependencies

dnf install epel-release -y
dnf install wget unzip curl nano policycoreutils-python-utils -y

Output:

[root@vps ~]#  dnf install epel-release -y
dnf install wget unzip curl nano policycoreutils-python-utils -y
Last metadata expiration check: 0:05:54 ago on Wed 05 Mar 2025 06:33:05 PM UT
Dependencies resolved.
=============================================================================
 Package             Architecture  Version           Repository            Si
=============================================================================
Installing:
 epel-release        noarch        10-2.el10s        extras-common         18

Transaction Summary
=============================================================================
Install  1 Package

Total download size: 18 k
Installed size: 25 k
Downloading Packages:
epel-release-10-2.el10s.noarch.rpm              220 kB/s |  18 kB     00:00
-----------------------------------------------------------------------------
Total                                            40 kB/s |  18 kB     00:00
CentOS Stream 10 - Extras packages              2.1 MB/s | 2.1 kB     00:00
Importing GPG key 0x1D997668:
 Userid     : "CentOS Extras SIG (https://wiki.centos.org/SpecialInterestGrou<security@centos.org>"
 Fingerprint: 363F C097 2F64 B699 AED3 968E 1FF6 A217 1D99 7668
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512
warning: Certificate 1FF6A2171D997668:
  Policy rejects subkey 8B5C8111FCA5D0FF: Policy rejected non-revocation signre (PrimaryKeyBinding) requiring second pre-image resistance
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1
  Installing       : epel-release-10-2.el10s.noarch                         1
  Running scriptlet: epel-release-10-2.el10s.noarch                         1
Many EPEL packages require the CodeReady Builder (CRB) repository.
It is recommended that you run /usr/bin/crb enable to enable the CRB reposito

Installed:
  epel-release-10-2.el10s.noarch

Complete!
Extra Packages for Enterprise Linux 10 - x86_64 2.0 MB/s | 3.6 MB     00:01
Last metadata expiration check: 0:00:03 ago on Wed 05 Mar 2025 06:39:04 PM UT
Package curl-8.9.1-5.el10.x86_64 is already installed.
Dependencies resolved.
=============================================================================
 Package                         Arch      Version           Repository    Si
=============================================================================
Installing:
 nano                            x86_64    8.1-3.el10        baseos       733
 policycoreutils-python-utils    noarch    3.8-1.el10        appstream     48
 unzip                           x86_64    6.0-66.el10       baseos       189
 wget                            x86_64    1.24.5-5.el10     appstream    803
Installing dependencies:
 checkpolicy                     x86_64    3.8-1.el10        appstream    358
 python3-audit                   x86_64    4.0.3-1.el10      appstream     66
 python3-distro                  noarch    1.9.0-5.el10      appstream     48

Install Apache Web Server

dnf install httpd -y
systemctl enable --now httpd
systemctl status httpd

Output:

[root@vps ~]# dnf install httpd -y
systemctl enable --now httpd
systemctl status httpd
Last metadata expiration check: 0:01:52 ago on Wed 05 Mar 2025 06:39:04 PM UTC.
Dependencies resolved.
=============================================================================
 Package                 Arch        Version            Repository      Size
=============================================================================
Installing:
 httpd                   x86_64      2.4.63-1.el10      appstream       49 k
Installing dependencies:
 apr                     x86_64      1.7.5-2.el10       appstream      129 k
 apr-util                x86_64      1.6.3-21.el10      appstream       99 k
 apr-util-lmdb           x86_64      1.6.3-21.el10      appstream       15 k
 centos-logos-httpd      noarch      100.2-2.el10       appstream      855 k
 httpd-core              x86_64      2.4.63-1.el10      appstream      1.5 M
 httpd-filesystem        noarch      2.4.63-1.el10      appstream       14 k
 httpd-tools             x86_64      2.4.63-1.el10      appstream       83 k
 mailcap                 noarch      2.1.54-8.el10      baseos          35 k
Installing weak dependencies:
 apr-util-openssl        x86_64      1.6.3-21.el10      appstream       17 k
 mod_http2               x86_64      2.0.29-2.el10      appstream      166 k
 mod_lua                 x86_64      2.4.63-1.el10      appstream       60 k

Transaction Summary
=============================================================================
Install  12 Packages

Total download size: 3.0 M
Installed size: 7.5 M
Downloading Packages:
(1/12): apr-1.7.5-2.el10.x86_64.rpm          775 kB/s | 129 kB     00:00
(2/12): apr-util-1.6.3-21.el10.x86_64.rpm    566 kB/s |  99 kB     00:00
(3/12): mailcap-2.1.54-8.el10.noarch.rpm     161 kB/s |  35 kB     00:00
(4/12): apr-util-lmdb-1.6.3-21.el10.x86_64.r 200 kB/s |  15 kB     00:00
(5/12): apr-util-openssl-1.6.3-21.el10.x86_6 221 kB/s |  17 kB     00:00
(6/12): httpd-2.4.63-1.el10.x86_64.rpm       518 kB/s |  49 kB     00:00
(7/12): httpd-core-2.4.63-1.el10.x86_64.rpm  9.3 MB/s | 1.5 MB     00:00
(8/12): httpd-filesystem-2.4.63-1.el10.noarc 177 kB/s |  14 kB     00:00
(9/12): mod_http2-2.0.29-2.el10.x86_64.rpm   1.2 MB/s | 166 kB     00:00
(10/12): mod_lua-2.4.63-1.el10.x86_64.rpm    600 kB/s |  60 kB     00:00
[MIRROR] centos-logos-httpd-100.2-2.el10.noarch.rpm: Curl error (28): Timeout was reached for https://centos-stream-distro.1gservers.com/10-stream/AppStream/x86_64/os/Packages/centos-logos-httpd-100.2-2.el10.noarch.rpm [Failed to connect to centos-stream-distro.1gservers.com port 443 after 30001 ms: Timeout was reached]
(11/12): centos-logos-httpd-100.2-2.el10.noa  28 kB/s | 855 kB     00:30
[MIRROR] httpd-tools-2.4.63-1.el10.x86_64.rpm: Curl error (28): Timeout was reached for http://centos-stream-distro.1gservers.com/10-stream/AppStream/x86_64/os/Packages/httpd-tools-2.4.63-1.el10.x86_64.rpm [Failed to connect to centos-stream-distro.1gservers.com port 80 after 30000 ms: Timeout was reached]
(12/12): httpd-tools-2.4.63-1.el10.x86_64.rp 2.7 kB/s |  83 kB     00:30
-----------------------------------------------------------------------------
Total                                         99 kB/s | 3.0 MB     00:30
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                     1/1
  Installing       : apr-1.7.5-2.el10.x86_64                            1/12
  Installing       : apr-util-lmdb-1.6.3-21.el10.x86_64                 2/12
  Installing       : apr-util-openssl-1.6.3-21.el10.x86_64              3/12
  Installing       : apr-util-1.6.3-21.el10.x86_64                      4/12
  Installing       : httpd-tools-2.4.63-1.el10.x86_64                   5/12
  Running scriptlet: httpd-filesystem-2.4.63-1.el10.noarch              6/12
  Installing       : httpd-filesystem-2.4.63-1.el10.noarch              6/12
  Installing       : centos-logos-httpd-100.2-2.el10.noarch             7/12
  Installing       : mailcap-2.1.54-8.el10.noarch                       8/12
  Installing       : httpd-core-2.4.63-1.el10.x86_64                    9/12
  Installing       : mod_http2-2.0.29-2.el10.x86_64                    10/12
  Installing       : mod_lua-2.4.63-1.el10.x86_64                      11/12
  Installing       : httpd-2.4.63-1.el10.x86_64                        12/12
  Running scriptlet: httpd-2.4.63-1.el10.x86_64                        12/12

Installed:
  apr-1.7.5-2.el10.x86_64
  apr-util-1.6.3-21.el10.x86_64
  apr-util-lmdb-1.6.3-21.el10.x86_64
  apr-util-openssl-1.6.3-21.el10.x86_64
  centos-logos-httpd-100.2-2.el10.noarch
  httpd-2.4.63-1.el10.x86_64
  httpd-core-2.4.63-1.el10.x86_64
  httpd-filesystem-2.4.63-1.el10.noarch
  httpd-tools-2.4.63-1.el10.x86_64
  mailcap-2.1.54-8.el10.noarch
  mod_http2-2.0.29-2.el10.x86_64
  mod_lua-2.4.63-1.el10.x86_64

Complete!
Created symlink '/etc/systemd/system/multi-user.target.wants/httpd.service' → '/usr/lib/systemd/system/httpd.service'.
● httpd.service - The Apache HTTP Server
     Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; preset:>
     Active: active (running) since Wed 2025-03-05 18:41:31 UTC; 78ms ago
 Invocation: a69ccff35e464bbabbc136607d04928c
       Docs: man:httpd.service(8)
   Main PID: 25326 (httpd)
     Status: "Started, listening on: port 80"
      Tasks: 177 (limit: 23188)
     Memory: 14M (peak: 14.6M)
        CPU: 166ms
     CGroup: /system.slice/httpd.service
             ├─25326 /usr/sbin/httpd -DFOREGROUND
             ├─25327 /usr/sbin/httpd -DFOREGROUND
             ├─25328 /usr/sbin/httpd -DFOREGROUND
             ├─25329 /usr/sbin/httpd -DFOREGROUND
             └─25330 /usr/sbin/httpd -DFOREGROUND

Install PHP 7.4 and Required Extensions

Since CentOS Stream 10 does not have PHP 7.4 in its default repository, you must install it manually.

Install necessary extensions:

dnf install php php-cli php-common php-mysqlnd php-xml php-gd php-mbstring php-curl php-intl php-zip php-bcmath php-json php-tokenizer php-ldap php-imagick -y

Output:

[root@vps ~]# dnf install php php-cli php-common php-mysqlnd php-xml php-gd php-mbstring php-curl php-intl php-zip php-bcmath php-json php-tokenizer php-ldap php-imagick -y
Last metadata expiration check: 0:21:16 ago on Wed 05 Mar 2025 07:00:49 PM UTC.
Dependencies resolved.
================================================================================
 Package                             Arch   Version             Repo       Size
================================================================================
Installing:
 php                                 x86_64 8.3.15-1.el10       appstream 8.4 k
 php-bcmath                          x86_64 8.3.15-1.el10       appstream  37 k
 php-cli                             x86_64 8.3.15-1.el10       appstream 3.3 M
 php-common                          x86_64 8.3.15-1.el10       appstream 695 k
 php-gd                              x86_64 8.3.15-1.el10       appstream  40 k
 php-intl                            x86_64 8.3.15-1.el10       appstream 158 k
 php-ldap                            x86_64 8.3.15-1.el10       appstream  43 k
 php-mbstring                        x86_64 8.3.15-1.el10       appstream 516 k
 php-mysqlnd                         x86_64 8.3.15-1.el10       appstream 131 k
 php-pecl-imagick                    x86_64 3.7.0-15.el10_0     epel      141 k
 php-pecl-zip                        x86_64 1.22.3-5.el10       appstream  62 k
 php-xml                             x86_64 8.3.15-1.el10       appstream 137 k
Installing dependencies:
 ImageMagick-libs                    x86_64 1:7.1.1.43-1.el10_0 epel      2.4 M
 LibRaw                              x86_64 0.21.3-1.el10_0     epel      415 k
 adobe-mappings-cmap                 noarch 20230622-5.el10     appstream 2.1 M
 adobe-mappings-cmap-deprecated      noarch 20230622-5.el10     appstream 115 k
 adobe-mappings-pdf                  noarch 20190401-9.el10     appstream 687 k
 avahi-libs                          x86_64 0.9~rc2-1.el10      baseos     68 k
 cairo                               x86_64 1.18.2-2.el10       appstream 713 k
 cairo-gobject                       x86_64 1.18.2-2.el10       appstream  18 k
 capstone                            x86_64 5.0.1-6.el10        appstream 1.0 M
 cups-filesystem                     noarch 1:2.4.10-11.el10    baseos     14 k
 cups-libs                           x86_64 1:2.4.10-11.el10    baseos    254 k
 duktape                             x86_64 2.7.0-10.el10       baseos    170 k
 fftw-libs-double                    x86_64 3.3.10-15.el10      appstream 1.0 M
 fontconfig                          x86_64 2.15.0-7.el10       appstream 280 k
 freetype                            x86_64 2.13.2-8.el10       baseos    409 k
 fribidi                             x86_64 1.0.14-4.el10       appstream  93 k
 gd                                  x86_64 2.3.3-19.el10       appstream 134 k
 gdk-pixbuf2                         x86_64 2.42.12-3.el10      appstream 498 k
 giflib                              x86_64 5.2.1-22.el10       appstream  53 k
 gnupg2                              x86_64 2.4.5-2.el10        baseos    2.7 M
 google-droid-sans-fonts             noarch 20200215-22.el10    appstream 2.7 M
 gpgme                               x86_64 1.23.2-6.el10       baseos    219 k

Verify PHP version:

php -v

It should display PHP 7.4.x.

Restart Apache:

systemctl restart httpd

Install MariaDB (Database)

dnf install mariadb-server -y
systemctl enable --now mariadb
systemctl status mariadb

Secure MariaDB

mysql_secure_installation

Follow the prompts:

  • Set root password: Yes
  • Remove anonymous users: Yes
  • Disallow root login remotely: Yes
  • Remove test database: Yes
  • Reload privileges tables: Yes

Create Database for ownCloud

mysql -u root -p

Run the following SQL commands:

CREATE DATABASE owncloud;
CREATE USER 'owncloud'@'localhost' IDENTIFIED BY 'StrongPassword';
GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Replace StrongPassword with a secure password.

Download and Install ownCloud

cd /var/www/html
wget https://download.owncloud.com/server/stable/owncloud-complete-latest.zip
unzip owncloud-complete-latest.zip
rm owncloud-complete-latest.zip
chown -R apache:apache owncloud
chmod -R 755 owncloud

Configure Apache for ownCloud

Create a new Apache configuration file:

nano /etc/httpd/conf.d/owncloud.conf

Add the following content:

<VirtualHost *:80>
    ServerAdmin admin@example.com
    DocumentRoot /var/www/html/owncloud
    ServerName your-server-ip

    <Directory /var/www/html/owncloud>
        Options FollowSymlinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog /var/log/httpd/owncloud_error.log
    CustomLog /var/log/httpd/owncloud_access.log combined
</VirtualHost>

Save and exit (CTRL+X, then Y, then Enter).

Restart Apache:

systemctl restart httpd

Adjust SELinux and Firewall

setsebool -P httpd_unified 1
setsebool -P httpd_execmem 1
setsebool -P httpd_can_network_connect 1
setsebool -P httpd_can_network_connect_db 1
restorecon -Rv /var/www/html/owncloud

Open firewall ports:

firewall-cmd --add-service=http --permanent
firewall-cmd --reload

Access ownCloud Web Interface

Open your browser and go to:

http://your-server-ip/
  • Create an admin username and password.
  • Enter database details (owncloud, owncloud, and the password you set).
  • Click Finish Setup.

Enable Cron for Background Tasks

crontab -u apache -e

Add:

*/15 * * * * /usr/bin/php -f /var/www/html/owncloud/cron.php

Save and exit.

ownCloud Installation Complete!

image
Now you can log in and start using ownCloud. 🚀


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS