OwnCloud Server Long Term Test
I have been a long time user of ownCloud, which allows the self hosting of a number of services, including file synchronisation, calendar, contacts and many other things. Note that I am talking about ownCloud server, rather than the more recent ownCloud Infinite Scale, which is aimed at enterprise file storage and collaboration, but somewhat inexplicably, does not include things like calendar and contacts, which from a personal point of view, means it is not currently an option for myself.
Note that this document isn't an attempt to persuade anybody as to why they might want to use ownCloud. That is left entirely up to the reader – I'm just documenting my own experiences of using it.
Although ownCloud maintains fairly extensive documentation and guides, I thought it might be interesting to write my own document, covering the steps for installing ownCloud server and then subsequently upgrading it, or the platform it runs on, noting any pitfalls on the way. The idea is to continue updating this document as time goes on, as a sort of long-term project, for at least as long as I continue to use ownCloud.
Introduction and Overview
The current ownCloud server is a PHP-based application and currently has very specific requirements for the version of PHP. At the time of writing (11-JUN-2025), it requires PHP 7.4. Astute readers will note that this version has been officially unmaintained for quite some time and somewhat inexplicably, there appears to be no obvious attempt to port the code to a more recent PHP version. There is a pinned forum post about ownCloud and PHP versions, which hasn't been updated in quite some time, but does point towards how PHP 7.4 is still being maintained externally and this issue is also referenced in the official documentation. I guess new installations could use the official ownCloud docker image, but that is not relevant to this particular document.
1. Installation
This section documents and installation of ownCloud server (currently 10.15) on Kubuntu 20.04. Note that for this purpose, I am using a VM, running under VirtualBox. Although this version of Ubuntu/Kubuntu is no longer within standard maintenance, the official ownCloud documentation still lists this as one of the officially supported configurations. Also, it is possible to sign up to an extended support from Canonical, which extends the support window for another five years. Finally, this version allows the direct installation of PHP 7.4, because that's what was available at the time of the LTS release.
We start by installing some commonly required packages. Note that most of these were already installed on the system.
apt-get update
apt-get -V install smbclient redis-server unzip openssl rsync imagemagick apt-transport-https curl
PHP
apt-get -V install php-fpm php-cgi
root@oclongtermtest:~# apt-get -V install php-fpm php-cgi Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: php-common (2:75) php7.4-cgi (7.4.3-4ubuntu2.29) php7.4-cli (7.4.3-4ubuntu2.29) php7.4-common (7.4.3-4ubuntu2.29) php7.4-fpm (7.4.3-4ubuntu2.29) php7.4-json (7.4.3-4ubuntu2.29) php7.4-opcache (7.4.3-4ubuntu2.29) php7.4-readline (7.4.3-4ubuntu2.29) Suggested packages: php-pear (1:1.10.9+submodules+notgz-1ubuntu0.20.04.3) The following NEW packages will be installed php-cgi (2:7.4+75) php-common (2:75) php-fpm (2:7.4+75) php7.4-cgi (7.4.3-4ubuntu2.29) php7.4-cli (7.4.3-4ubuntu2.29) php7.4-common (7.4.3-4ubuntu2.29) php7.4-fpm (7.4.3-4ubuntu2.29) php7.4-json (7.4.3-4ubuntu2.29) php7.4-opcache (7.4.3-4ubuntu2.29) php7.4-readline (7.4.3-4ubuntu2.29) 0 to upgrade, 10 to newly install, 0 to remove and 0 not to upgrade. Need to get 5,483 kB of archives. After this operation, 27.5 MB of additional disk space will be used. Do you want to continue? [Y/n]
Note that in the official documentation, the following includes the install of "php-pear", but I'm not installing it because it's not included on my production environment. If he becomes necessary, I can install it later.
apt-get -V install php php-mysql php-mbstring php-intl php-imagick php-redis php-apcu php-igbinary php-gmp php-bcmath php-curl php-gd php-zip php-imap php-ldap php-bz2 php-ssh2 php-phpseclib php-common php-json php-xml php-dev libsmbclient-dev
root@oclongtermtest:~# apt-get -V install php php-mysql php-mbstring php-intl php-imagick php-redis php-apcu php-igbinary php-gmp php-bcmath php-curl php-gd php-zip php-imap php-ldap php-bz2 php-ssh2 php-phpseclib php-common php-json php-xml php-dev libsmbclient-dev Reading package lists... Done Building dependency tree Reading state information... Done php-common is already the newest version (2:75). php-common set to manually installed. The following additional packages will be installed: autoconf (2.69-11.1) automake (1:1.16.1-4ubuntu6) autopoint (0.19.8.1-10build1) autotools-dev (20180224.1) build-essential (12.8ubuntu1.1) debhelper (12.10ubuntu1) dh-autoreconf (19) dh-strip-nondeterminism (1.7.0-1) dpkg-dev (1.19.7ubuntu3.2) dwz (0.13-5) fakeroot (1.24-1) g++ (4:9.3.0-1ubuntu2) g++-9 (9.4.0-1ubuntu1~20.04.2) gettext (0.19.8.1-10build1) intltool-debian (0.35.0+20060710.5) libalgorithm-diff-perl (1.19.03-2) libalgorithm-diff-xs-perl (0.04-6) libalgorithm-merge-perl (0.08-3) libarchive-cpio-perl (0.10-1) libarchive-zip-perl (1.67-2) libc-client2007e (8:2007f~dfsg-7) libcroco3 (0.6.13-1ubuntu0.1) libdebhelper-perl (12.10ubuntu1) libdpkg-perl (1.19.7ubuntu3.2) libfakeroot (1.24-1) libfile-fcntllock-perl (0.22-3build4) libfile-stripnondeterminism-perl (1.7.0-1) libltdl-dev (2.4.6-14) libmail-sendmail-perl (0.80-1) libonig5 (6.9.4-1) libpcre2-32-0 (10.34-7ubuntu0.1) libpcre2-dev (10.34-7ubuntu0.1) libpcre2-posix2 (10.34-7ubuntu0.1) libsigsegv2 (2.12-2) libssl-dev (1.1.1f-1ubuntu2.24) libstdc++-9-dev (9.4.0-1ubuntu1~20.04.2) libsub-override-perl (0.09-2) libsys-hostname-long-perl (1.5-1) libtool (2.4.6-14) m4 (1.4.18-4) mlock (8:2007f~dfsg-7) php-apcu-bc (1.0.5-2build1) php-pear (1:1.10.9+submodules+notgz-1ubuntu0.20.04.3) php7.4 (7.4.3-4ubuntu2.29) php7.4-bcmath (7.4.3-4ubuntu2.29) php7.4-bz2 (7.4.3-4ubuntu2.29) php7.4-curl (7.4.3-4ubuntu2.29) php7.4-dev (7.4.3-4ubuntu2.29) php7.4-gd (7.4.3-4ubuntu2.29) php7.4-gmp (7.4.3-4ubuntu2.29) php7.4-imap (7.4.3-4ubuntu2.29) php7.4-intl (7.4.3-4ubuntu2.29) php7.4-ldap (7.4.3-4ubuntu2.29) php7.4-mbstring (7.4.3-4ubuntu2.29) php7.4-mysql (7.4.3-4ubuntu2.29) php7.4-xml (7.4.3-4ubuntu2.29) php7.4-zip (7.4.3-4ubuntu2.29) pkg-php-tools (1.38) po-debconf (1.0.21) shtool (2.0.8-10) ttf-dejavu-core (2.37-1) Suggested packages: autoconf-archive (20190106-2.1ubuntu1) gnu-standards (2010.03.11-1.1) autoconf-doc (2.69-11.1) dh-make (2.201903) debian-keyring (2020.03.24) g++-multilib (4:9.3.0-1ubuntu2) g++-9-multilib (9.4.0-1ubuntu1~20.04.2) gcc-9-doc (9.4.0-1ubuntu1~20.04.2) gettext-doc (0.19.8.1-10build1) libasprintf-dev (0.19.8.1-10build1) libgettextpo-dev (0.19.8.1-10build1) uw-mailutils (8:2007f~dfsg-7) git (1:2.25.1-1ubuntu3.14) bzr (2.7.0+bzr6622+brz) libtool-doc (2.4.6-14) libssl-doc (1.1.1f-1ubuntu2.24) libstdc++-9-doc (9.4.0-1ubuntu1~20.04.2) gfortran (4:9.3.0-1ubuntu2) | fortran95-compiler gcj-jdk m4-doc (1.4.18-4) php-libsodium php-mcrypt dh-php (0.35) libmail-box-perl (3.008-1) The following NEW packages will be installed autoconf (2.69-11.1) automake (1:1.16.1-4ubuntu6) autopoint (0.19.8.1-10build1) autotools-dev (20180224.1) build-essential (12.8ubuntu1.1) debhelper (12.10ubuntu1) dh-autoreconf (19) dh-strip-nondeterminism (1.7.0-1) dpkg-dev (1.19.7ubuntu3.2) dwz (0.13-5) fakeroot (1.24-1) g++ (4:9.3.0-1ubuntu2) g++-9 (9.4.0-1ubuntu1~20.04.2) gettext (0.19.8.1-10build1) intltool-debian (0.35.0+20060710.5) libalgorithm-diff-perl (1.19.03-2) libalgorithm-diff-xs-perl (0.04-6) libalgorithm-merge-perl (0.08-3) libarchive-cpio-perl (0.10-1) libarchive-zip-perl (1.67-2) libc-client2007e (8:2007f~dfsg-7) libcroco3 (0.6.13-1ubuntu0.1) libdebhelper-perl (12.10ubuntu1) libdpkg-perl (1.19.7ubuntu3.2) libfakeroot (1.24-1) libfile-fcntllock-perl (0.22-3build4) libfile-stripnondeterminism-perl (1.7.0-1) libltdl-dev (2.4.6-14) libmail-sendmail-perl (0.80-1) libonig5 (6.9.4-1) libpcre2-32-0 (10.34-7ubuntu0.1) libpcre2-dev (10.34-7ubuntu0.1) libpcre2-posix2 (10.34-7ubuntu0.1) libsigsegv2 (2.12-2) libsmbclient-dev (2:4.15.13+dfsg-0ubuntu0.20.04.8) libssl-dev (1.1.1f-1ubuntu2.24) libstdc++-9-dev (9.4.0-1ubuntu1~20.04.2) libsub-override-perl (0.09-2) libsys-hostname-long-perl (1.5-1) libtool (2.4.6-14) m4 (1.4.18-4) mlock (8:2007f~dfsg-7) php (2:7.4+75) php-apcu (5.1.18+4.0.11-1build1) php-apcu-bc (1.0.5-2build1) php-bcmath (2:7.4+75) php-bz2 (2:7.4+75) php-curl (2:7.4+75) php-dev (2:7.4+75) php-gd (2:7.4+75) php-gmp (2:7.4+75) php-igbinary (3.1.2+2.0.8-1build1) php-imagick (3.4.4-4) php-imap (2:7.4+75) php-intl (2:7.4+75) php-json (2:7.4+75) php-ldap (2:7.4+75) php-mbstring (2:7.4+75) php-mysql (2:7.4+75) php-pear (1:1.10.9+submodules+notgz-1ubuntu0.20.04.3) php-phpseclib (2.0.23-2) php-redis (5.1.1+4.3.0-1) php-ssh2 (1.2+0.13-1build1) php-xml (2:7.4+75) php-zip (2:7.4+75) php7.4 (7.4.3-4ubuntu2.29) php7.4-bcmath (7.4.3-4ubuntu2.29) php7.4-bz2 (7.4.3-4ubuntu2.29) php7.4-curl (7.4.3-4ubuntu2.29) php7.4-dev (7.4.3-4ubuntu2.29) php7.4-gd (7.4.3-4ubuntu2.29) php7.4-gmp (7.4.3-4ubuntu2.29) php7.4-imap (7.4.3-4ubuntu2.29) php7.4-intl (7.4.3-4ubuntu2.29) php7.4-ldap (7.4.3-4ubuntu2.29) php7.4-mbstring (7.4.3-4ubuntu2.29) php7.4-mysql (7.4.3-4ubuntu2.29) php7.4-xml (7.4.3-4ubuntu2.29) php7.4-zip (7.4.3-4ubuntu2.29) pkg-php-tools (1.38) po-debconf (1.0.21) shtool (2.0.8-10) ttf-dejavu-core (2.37-1) 0 to upgrade, 83 to newly install, 0 to remove and 0 not to upgrade. Need to get 21.3 MB of archives. After this operation, 94.9 MB of additional disk space will be used. Do you want to continue? [Y/n]
apt-get -V install libapache2-mod-php apache2
root@oclongtermtest:~# apt-get -V install libapache2-mod-php apache2 Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: apache2-bin (2.4.41-4ubuntu3.23) apache2-data (2.4.41-4ubuntu3.23) apache2-utils (2.4.41-4ubuntu3.23) libapache2-mod-php7.4 (7.4.3-4ubuntu2.29) libapr1 (1.6.5-1ubuntu1.1) libaprutil1 (1.6.1-4ubuntu2.2) libaprutil1-dbd-sqlite3 (1.6.1-4ubuntu2.2) libaprutil1-ldap (1.6.1-4ubuntu2.2) Suggested packages: apache2-doc (2.4.41-4ubuntu3.23) apache2-suexec-pristine (2.4.41-4ubuntu3.23) | apache2-suexec-custom (2.4.41-4ubuntu3.23) php-pear (1:1.10.9+submodules+notgz-1ubuntu0.20.04.3) The following NEW packages will be installed apache2 (2.4.41-4ubuntu3.23) apache2-bin (2.4.41-4ubuntu3.23) apache2-data (2.4.41-4ubuntu3.23) apache2-utils (2.4.41-4ubuntu3.23) libapache2-mod-php (2:7.4+75) libapache2-mod-php7.4 (7.4.3-4ubuntu2.29) libapr1 (1.6.5-1ubuntu1.1) libaprutil1 (1.6.1-4ubuntu2.2) libaprutil1-dbd-sqlite3 (1.6.1-4ubuntu2.2) libaprutil1-ldap (1.6.1-4ubuntu2.2) 0 to upgrade, 10 to newly install, 0 to remove and 0 not to upgrade. Need to get 3,094 kB of archives. After this operation, 12.2 MB of additional disk space will be used. Do you want to continue? [Y/n]
apt-get -V install mysql-server mysql-client
root@oclongtermtest:~# apt-get -V install mysql-server mysql-client Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libaio1 (0.3.112-5) libcgi-fast-perl (1:2.15-1) libcgi-pm-perl (4.46-1) libevent-core-2.1-7 (2.1.11-stable-1) libevent-pthreads-2.1-7 (2.1.11-stable-1) libfcgi-perl (0.79-1ubuntu0.1) libhtml-template-perl (2.97-1) libmecab2 (0.996-10build1) mecab-ipadic (2.7.0-20070801+main-2.1) mecab-ipadic-utf8 (2.7.0-20070801+main-2.1) mecab-utils (0.996-10build1) mysql-client-8.0 (8.0.42-0ubuntu0.20.04.1) mysql-client-core-8.0 (8.0.42-0ubuntu0.20.04.1) mysql-server-8.0 (8.0.42-0ubuntu0.20.04.1) mysql-server-core-8.0 (8.0.42-0ubuntu0.20.04.1) Suggested packages: libipc-sharedcache-perl (1.3-9) mailx tinyca (0.7.5-6) The following NEW packages will be installed libaio1 (0.3.112-5) libcgi-fast-perl (1:2.15-1) libcgi-pm-perl (4.46-1) libevent-core-2.1-7 (2.1.11-stable-1) libevent-pthreads-2.1-7 (2.1.11-stable-1) libfcgi-perl (0.79-1ubuntu0.1) libhtml-template-perl (2.97-1) libmecab2 (0.996-10build1) mecab-ipadic (2.7.0-20070801+main-2.1) mecab-ipadic-utf8 (2.7.0-20070801+main-2.1) mecab-utils (0.996-10build1) mysql-client (8.0.42-0ubuntu0.20.04.1) mysql-client-8.0 (8.0.42-0ubuntu0.20.04.1) mysql-client-core-8.0 (8.0.42-0ubuntu0.20.04.1) mysql-server (8.0.42-0ubuntu0.20.04.1) mysql-server-8.0 (8.0.42-0ubuntu0.20.04.1) mysql-server-core-8.0 (8.0.42-0ubuntu0.20.04.1) 0 to upgrade, 17 to newly install, 0 to remove and 0 not to upgrade. Need to get 36.7 MB of archives. After this operation, 318 MB of additional disk space will be used. Do you want to continue? [Y/n]
Note that when we run the command to perform the secure setup of the MySQL database, no password is set for the root user. This did not use to be the case. In versions of the database earlier than a certain point, it did prompt for the root password. As I understand it, this is because you are able to login to a database user without the password as long as your OS (in this case root) user has itself been authenticated (by a successful login) and the database and OS user matches by name. This is explained in the answer to a forum question: Is it safe to leave MySQL root user without a password if it uses auth_socket?. That means the database is as secure as the OS user is.
As a side note, if felt necessary, it is still possible to set up a requirement to provide a password for the root database user following installation. I will not do so in this case.
mysql_secure_installation
root@oclongtermtest:~# mysql_secure_installation Securing the MySQL server deployment. Connecting to MySQL using a blank password. VALIDATE PASSWORD COMPONENT can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD component? Press y|Y for Yes, any other key for No: Skipping password set for root as authentication with auth_socket is used by default. If you would like to use password authentication instead, this can be done with the "ALTER_USER" command. See https://dev.mysql.com/doc/refman/8.0/en/alter-user.html#alter-user-password-management for more information. By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL 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? (Press y|Y for Yes, any other key for No) : 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? (Press y|Y for Yes, any other key for No) : Y Success. By default, MySQL 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? (Press y|Y for Yes, any other key for No) : 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? (Press y|Y for Yes, any other key for No) : Y Success. All done!
mysqladmin -u root -p version
root@oclongtermtest:~# mysqladmin -u root -p version Enter password: mysqladmin Ver 8.0.42-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu)) Copyright (c) 2000, 2025, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Server version 8.0.42-0ubuntu0.20.04.1 Protocol version 10 Connection Localhost via UNIX socket UNIX socket /var/run/mysqld/mysqld.sock Uptime: 5 min 31 sec Threads: 2 Questions: 10 Slow queries: 0 Opens: 132 Flush tables: 3 Open tables: 51 Queries per second avg: 0.030
We need to create a user that will have the privileges to then go on and created the ownCloud database later on. We begin by logging in as a root MySQL user and then run the appropriate commands.
mysql
root@oclongtermtest:~# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 13 Server version: 8.0.42-0ubuntu0.20.04.1 (Ubuntu) Copyright (c) 2000, 2025, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE USER IF NOT EXISTS 'dbadmin'@'localhost' IDENTIFIED BY 'oc_mydbadmin_password'; Query OK, 0 rows affected (0.08 sec) mysql> GRANT ALL PRIVILEGES ON *.* TO 'dbadmin'@'localhost' WITH GRANT OPTION; Query OK, 0 rows affected (0.05 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.03 sec) mysql> exit Bye
vi /etc/apache2/sites-available/owncloud.conf
cat /etc/apache2/sites-available/owncloud.conf
Alias /owncloud "/var/www/owncloud/" <Directory /var/www/owncloud/> Options +FollowSymlinks AllowOverride All <IfModule mod_dav.c> Dav off </IfModule> </Directory>
ln -s /etc/apache2/sites-available/owncloud.conf /etc/apache2/sites-enabled/owncloud.conf
Certain Apache modules are required and others are recommended. The following commands enable those modules. Note that some of them were already enabled before I ran the command. The final command is required to reload configuration.
a2enmod rewrite
a2enmod headers
a2enmod env
a2enmod dir
a2enmod mime
a2enmod unique_id
systemctl restart apache2
Note that, as this is merely a test of installation and configuration, I am not concerned about setting up SSL certificates. That would only be necessary if this was to be accessed externally, which it won't be.
[VM Snapshot]
echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/server:/10/Ubuntu_20.04/ /' | tee /etc/apt/sources.list.d/isv:ownCloud:server:10.list
curl -fsSL https://download.opensuse.org/repositories/isv:ownCloud:server:10/Ubuntu_20.04/Release.key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/isv_ownCloud_server_10.gpg > /dev/null
apt-get update
Finally, we are in a position to install the ownCloud server packages, using the following command:
apt-get -V install owncloud-complete-files
root@oclongtermtest:~# ls -ld /var/www/owncloud ls: cannot access '/var/www/owncloud': No such file or directory root@oclongtermtest:~# apt-get -V install owncloud-complete-files Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: owncloud-deps The following NEW packages will be installed owncloud-complete-files (10.15.2-1+12.1) 0 to upgrade, 1 to newly install, 0 to remove and 0 not to upgrade. Need to get 63.4 MB of archives. After this operation, 269 MB of additional disk space will be used. Get:1 http://ftp.gwdg.de/pub/opensuse/repositories/isv:/ownCloud:/server:/10/Ubuntu_20.04 owncloud-complete-files 10.15.2-1+12.1 [63.4 MB] Fetched 63.4 MB in 4s (15.1 MB/s) Selecting previously unselected package owncloud-complete-files. (Reading database ... 215678 files and directories currently installed.) Preparing to unpack .../owncloud-complete-files_10.15.2-1+12.1_all.deb ... Unpacking owncloud-complete-files (10.15.2-1+12.1) ... Setting up owncloud-complete-files (10.15.2-1+12.1) ...
Note that after this, we can now see that there is the directory "/var/www/owncloud" created. The directory permissions have been set as necessary by the package installation, so no further work is necessary on that.
ls -ld /var/www/owncloud/
root@oclongtermtest:~# ls -ld /var/www/owncloud/ drwxr-xr-x 16 root root 4096 Jun 13 14:45 /var/www/owncloud/
cd /var/www/owncloud/
sudo -u www-data ./occ maintenance:install --database "mysql" --database-name "owncloud" --database-user "dbadmin" --database-pass "oc_mydbadmin_password" --admin-user "ocadmin" --admin-pass "my_owncloud_admin_password"
Having performed the installation, I then wanted to finish the ownCloud setup. I decided to use the command line to do this, which as far as I understand should be as follows:
cd /var/www/owncloud/
sudo -u www-data ./occ maintenance:install --database "mysql" --database-name "owncloud" --database-user "dbadmin" --database-pass "oc_mydbadmin_password" --admin-user "ocadmin" --admin-pass "my_owncloud_admin_password"
root@oclongtermtest:/var/www/owncloud# sudo -u www-data ./occ maintenance:install --database "mysql" --database-name "owncloud" --database-user "dbadmin" --database-pass "oc_mydbadmin_password" --admin-user "ocadmin" --admin-pass "my_owncloud_admin_password" ownCloud was successfully installed
The ownCloud server has been set up, but when we attempt to access the URL at "http://oclongtermtest.local/owncloud", we get the following screen indicating that we need to set up some trusted domain configuration.
[Screenshot]
To solve this problem, we have to alter our config.php file, in order to add the appropriate trusted domain.
cd /var/www/owncloud/config
cp config.php config.php.bak1
vi config.php
diff config.php config.php.bak1
root@oclongtermtest:/var/www/owncloud/config# diff config.php config.php.bak1 9d8 < 1 => 'oclongtermtest.local',
systemctl restart apache2
After we go through the steps, we can access the ownCloud login page from a browser not running on localhost.
[Screenshot]
We are now able to log in as administrator and after a splash screen directing us towards downloading the ownCloud app, we can access the admin dashboard.
[Screenshot]
[VM Snapshot]
From the administration's screen, we are in a position to create a normal user. As part of our testing, we can then log into that user and upload a few files.
[Screenshot]
[VM snapshot]
2. Upgrading Kubuntu from Version 20.04 to Version 22.04
At the time of writing this article )24-JUN-2025), Kubuntu 20.04 is out of the regular maintenance cycle and is therefore unsupported. It is still possible to get extended security maintenance from Ubuntu, but there are plenty of circumstances that would make it wise to move to at least Kubuntu 22.04 (with or without Ubuntu Pro support). Therefore, this section documents the steps required to upgrade the installed ownCloud server setup that we completed in the first section.
The basic upgrade mechanism for Kubuntu/Ubuntu is normally very solid, but ownCloud server, things are complicated by the need for a specific version of PHP. That represents the real potential problem, which relies on setting up one of the external sources that still maintains PHP 7.4.
mysqldump --lock-tables -u root -p owncloud > /root/owncloud-sqlbkp_`date +"%Y%m%d"`.bak
root@oclongtermtest:/var/www/owncloud# mysqldump --lock-tables -u root -p owncloud > /root/owncloud-sqlbkp_`date +"%Y%m%d"`.bak Enter password:
do-release-upgrade
root@oclongtermtest:/var/www/owncloud# do-release-upgrade Checking for a new Ubuntu release Get:1 Upgrade tool signature [833 B] Get:2 Upgrade tool [1,267 kB] Fetched 1,268 kB in 0s (0 B/s) authenticate 'jammy.tar.gz' against 'jammy.tar.gz.gpg' extracting 'jammy.tar.gz' Reading cache Checking package manager Continue running under SSH? This session appears to be running under SSH. It is not recommended to perform a upgrade over SSH currently because in case of failure it is harder to recover. If you continue, an additional SSH daemon will be started at port '1022'. Do you want to continue? Continue [yN] y Starting additional sshd To make recovery in case of failure easier, an additional sshd will be started on port '1022'. If anything goes wrong with the running ssh you can still connect to the additional one. If you run a firewall, you may need to temporarily open this port. As this is potentially dangerous it's not done automatically. You can open the port with e.g.: 'iptables -I INPUT -p tcp --dport 1022 -j ACCEPT' To continue please press [ENTER] Reading package lists... Done Building dependency tree Reading state information... Done Hit http://gb.archive.ubuntu.com/ubuntu focal InRelease Get:1 http://gb.archive.ubuntu.com/ubuntu focal-updates InRelease [128 kB] Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [128 kB] Get:3 http://gb.archive.ubuntu.com/ubuntu focal-backports InRelease [128 kB] Get:4 http://gb.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [276 kB] Get:5 http://gb.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 DEP-11 Metadata [212 B] Get:6 http://gb.archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [446 kB] Get:7 http://gb.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [940 B] Get:8 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [74.6 kB] Get:9 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 DEP-11 Metadata [212 B] Get:10 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [160 kB] Get:11 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 DEP-11 Metadata [940 B] Get:12 http://gb.archive.ubuntu.com/ubuntu focal-backports/main amd64 DEP-11 Metadata [7,980 B] Get:13 http://gb.archive.ubuntu.com/ubuntu focal-backports/restricted amd64 DEP-11 Metadata [216 B] Get:14 http://gb.archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [30.5 kB] Get:15 http://gb.archive.ubuntu.com/ubuntu focal-backports/multiverse amd64 DEP-11 Metadata [212 B] Hit http://download.opensuse.org/repositories/isv:/ownCloud:/server:/10/Ubuntu_20.04 InRelease Fetched 1,381 kB in 0s (0 B/s) Reading package lists... Done Building dependency tree Reading state information... Done None No snaps are installed yet. Try 'snap install hello-world'. Checking for installed snaps Calculating snap size requirements Updating repository information Third party sources disabled Some third party entries in your sources.list were disabled. You can re-enable them after the upgrade with the 'software-properties' tool or your package manager. To continue please press [ENTER] ... ... Do you want to start the upgrade? 42 packages are going to be removed. 330 new packages are going to be installed. 1801 packages are going to be upgraded. You have to download a total of 2,091 M. This download should take about 2 minutes with your connection. Installing the upgrade can take several hours. Once the download has finished, the process cannot be cancelled. Continue [yN] Details [d]y ... ...
[Screenshot]
... ...
[Screenshot]
Upgrading Fetched 0 B in 0s (0 B/s) Extract templates from packages: 100% Preconfiguring packages ... setting xserver-xorg-legacy/xwrapper/allowed_users from configuration file Extract templates from packages: 100% ... ...
[Screenshot - firefox snap]
... ... Remove obsolete packages? ... ... 182 packages are going to be removed. Removing the packages can take several hours. Continue [yN] Details [d]y ... ...
[Screenshot - dictionary]
... ... System upgrade is complete. Restart required To complete the upgrade, a system restart is required. If you select 'y' the system will be restarted. Continue [yN] y
Note that the test VM then successfully restarted, although as it did so, I could see the following message appearing, which clearly indicates that some issue needs to be sorted out (although this is perhaps unsurprising):
[Failed] Failed to start the Apache HTTP Server.
systemctl status apache2
root@oclongtermtest:~# systemctl status apache2 × apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Thu 2025-06-26 15:25:16 BST; 17min ago Docs: https://httpd.apache.org/docs/2.4/ Process: 629 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE) CPU: 26ms Jun 26 15:25:15 oclongtermtest systemd[1]: Starting The Apache HTTP Server... Jun 26 15:25:16 oclongtermtest apachectl[675]: apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2> Jun 26 15:25:16 oclongtermtest apachectl[629]: Action 'start' failed. Jun 26 15:25:16 oclongtermtest apachectl[629]: The Apache error log may have more information. Jun 26 15:25:16 oclongtermtest systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE Jun 26 15:25:16 oclongtermtest systemd[1]: apache2.service: Failed with result 'exit-code'. Jun 26 15:25:16 oclongtermtest systemd[1]: Failed to start The Apache HTTP Server.
grep -r --include '*.list' '^deb ' /etc/apt/sources.list /etc/apt/sources.list.d/
root@oclongtermtest:~# grep -r --include '*.list' '^deb ' /etc/apt/sources.list /etc/apt/sources.list.d/ /etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ jammy main restricted /etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ jammy-updates main restricted /etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ jammy universe /etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ jammy-updates universe /etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ jammy multiverse /etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ jammy-updates multiverse /etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse /etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu jammy-security main restricted /etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu jammy-security universe /etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu jammy-security multiverse
php -v
root@oclongtermtest:~# php -v PHP 8.1.2-1ubuntu2.21 (cli) (built: Mar 24 2025 19:04:23) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.2, Copyright (c) Zend Technologies with Zend OPcache v8.1.2-1ubuntu2.21, Copyright (c), by Zend Technologies
dpkg -l | grep php | awk '{print $2}' | tr "n" " "
root@oclongtermtest:~# dpkg -l | grep php | awk '{print $2}' | tr "\n" " " libapache2-mod-php libapache2-mod-php7.4 libapache2-mod-php8.1 php php-apcu php-apcu-bc php-bcmath php-bz2 php-cgi php-common php-curl php-dev php-fpm php-gd php-gmp php-igbinary php-imagick php-imap php-intl php-json php-ldap php-mbstring php-mysql php-pear php-phpseclib php-redis php-ssh2 php-xml php-zip php7.4-bcmath php7.4-bz2 php7.4-cgi php7.4-cli php7.4-common php7.4-curl php7.4-fpm php7.4-gd php7.4-gmp php7.4-imap php7.4-intl php7.4-json php7.4-ldap php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-readline php7.4-xml php7.4-zip php8.1 php8.1-apcu php8.1-bcmath php8.1-bz2 php8.1-cgi php8.1-cli php8.1-common php8.1-curl php8.1-dev php8.1-fpm php8.1-gd php8.1-gmp php8.1-igbinary php8.1-imagick php8.1-imap php8.1-intl php8.1-ldap php8.1-mbstring php8.1-mysql php8.1-opcache php8.1-phpdbg php8.1-readline php8.1-redis php8.1-ssh2 php8.1-xml php8.1-zip pkg-php-tools
ls /etc/apache2/mods-available/php*
ls /etc/apache2/mods-enabled/php*
root@oclongtermtest:~# ls /etc/apache2/mods-available/php* /etc/apache2/mods-available/php7.4.conf /etc/apache2/mods-available/php8.1.conf /etc/apache2/mods-available/php7.4.load /etc/apache2/mods-available/php8.1.load root@oclongtermtest:~# ls /etc/apache2/mods-enabled/php* /etc/apache2/mods-enabled/php7.4.conf /etc/apache2/mods-enabled/php7.4.load
apt-get purge `dpkg -l | grep php | awk '{print $2}' | tr "n" " "`
root@oclongtermtest:~# apt-get purge `dpkg -l | grep php | awk '{print $2}' | tr "\n" " "` Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages were automatically installed and are no longer required: libc-client2007e libffi7 libonig5 libpcre2-32-0 libpcre2-dev libpcre2-posix3 libssl-dev linux-headers-5.15.0-139 linux-headers-5.15.0-139-generic linux-image-5.15.0-139-generic linux-modules-5.15.0-139-generic linux-modules-extra-5.15.0-139-generic mlock pkg-config shtool Use 'apt autoremove' to remove them. The following packages will be REMOVED libapache2-mod-php* libapache2-mod-php7.4* libapache2-mod-php8.1* php* php-apcu* php-apcu-bc* php-bcmath* php-bz2* php-cgi* php-common* php-curl* php-dev* php-fpm* php-gd* php-gmp* php-igbinary* php-imagick* php-imap* php-intl* php-json* php-ldap* php-mbstring* php-mysql* php-pear* php-phpseclib* php-redis* php-ssh2* php-xml* php-zip* php7.4-bcmath* php7.4-bz2* php7.4-cgi* php7.4-cli* php7.4-common* php7.4-curl* php7.4-fpm* php7.4-gd* php7.4-gmp* php7.4-imap* php7.4-intl* php7.4-json* php7.4-ldap* php7.4-mbstring* php7.4-mysql* php7.4-opcache* php7.4-readline* php7.4-xml* php7.4-zip* php8.1* php8.1-apcu* php8.1-bcmath* php8.1-bz2* php8.1-cgi* php8.1-cli* php8.1-common* php8.1-curl* php8.1-dev* php8.1-fpm* php8.1-gd* php8.1-gmp* php8.1-igbinary* php8.1-imagick* php8.1-imap* php8.1-intl* php8.1-ldap* php8.1-mbstring* php8.1-mysql* php8.1-opcache* php8.1-phpdbg* php8.1-readline* php8.1-redis* php8.1-ssh2* php8.1-xml* php8.1-zip* pkg-php-tools* 0 to upgrade, 0 to newly install, 75 to remove and 0 not to upgrade. After this operation, 58.3 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 287471 files and directories currently installed.) Removing libapache2-mod-php (2:8.1+92ubuntu1) ... Removing php (2:8.1+92ubuntu1) ... Removing php8.1 (8.1.2-1ubuntu2.21) ... Removing php-ssh2 (1.3.1+0.13-6) ... Removing php8.1-ssh2 (1.3.1+0.13-6) ... Removing pkg-php-tools (1.42build1) ... Removing php-json (2:8.1+92ubuntu1) ... Removing php-redis (5.3.5+4.3.0-5.1) ... Removing php8.1-redis (5.3.5+4.3.0-5.1) ... Removing libapache2-mod-php8.1 (8.1.2-1ubuntu2.21) ... apache2_invoke php8.1 prerm: No action required Removing php-apcu (5.1.21+4.0.11-7ubuntu1) ... Removing php-bcmath (2:8.1+92ubuntu1) ... Removing php-bz2 (2:8.1+92ubuntu1) ... Removing php-cgi (2:8.1+92ubuntu1) ... update-alternatives: using /usr/bin/php-cgi8.1 to provide /usr/bin/php-cgi (php-cgi) in auto mode update-alternatives: using /usr/lib/cgi-bin/php8.1 to provide /usr/lib/cgi-bin/php (php-cgi-bin) in auto mode Removing php-zip (2:8.1+92ubuntu1) ... Removing php8.1-zip (8.1.2-1ubuntu2.21) ... Removing php-intl (2:8.1+92ubuntu1) ... Removing php8.1-intl (8.1.2-1ubuntu2.21) ... Removing php-curl (2:8.1+92ubuntu1) ... Removing php-dev (2:8.1+92ubuntu1) ... update-alternatives: using /usr/bin/php-config8.1 to provide /usr/bin/php-config (php-config) in auto mode update-alternatives: using /usr/bin/phpize8.1 to provide /usr/bin/phpize (phpize) in auto mode Removing php-fpm (2:8.1+92ubuntu1) ... Removing php-gd (2:8.1+92ubuntu1) ... Removing php-gmp (2:8.1+92ubuntu1) ... Removing php-igbinary (3.2.6+2.0.8-7ubuntu1) ... Removing php-imagick (3.6.0-4ubuntu1) ... Removing php-imap (2:8.1+92ubuntu1) ... Removing php-ldap (2:8.1+92ubuntu1) ... Removing php-mbstring (2:8.1+92ubuntu1) ... Removing php-mysql (2:8.1+92ubuntu1) ... Removing php-pear (1:1.10.12+submodules+notgz+20210212-1ubuntu3) ... Removing php-phpseclib (2.0.36-1) ... Removing php-xml (2:8.1+92ubuntu1) ... Removing php8.1-apcu (5.1.21+4.0.11-7ubuntu1) ... Removing php8.1-bcmath (8.1.2-1ubuntu2.21) ... Removing php8.1-bz2 (8.1.2-1ubuntu2.21) ... Removing php8.1-imagick (3.6.0-4ubuntu1) ... Removing php8.1-cgi (8.1.2-1ubuntu2.21) ... apache2_invoke php8.1-cgi prerm: No action required Removing php8.1-dev (8.1.2-1ubuntu2.21) ... Removing php8.1-igbinary (3.2.6+2.0.8-7ubuntu1) ... Removing php8.1-phpdbg (8.1.2-1ubuntu2.21) ... Removing php8.1-imap (8.1.2-1ubuntu2.21) ... Removing php8.1-curl (8.1.2-1ubuntu2.21) ... Removing php8.1-fpm (8.1.2-1ubuntu2.21) ... apache2_invoke php8.1-fpm prerm: No action required Removing php8.1-gd (8.1.2-1ubuntu2.21) ... Removing php8.1-gmp (8.1.2-1ubuntu2.21) ... Removing php8.1-ldap (8.1.2-1ubuntu2.21) ... Removing php8.1-mbstring (8.1.2-1ubuntu2.21) ... Removing php8.1-mysql (8.1.2-1ubuntu2.21) ... Removing php8.1-xml (8.1.2-1ubuntu2.21) ... Removing php8.1-cli (8.1.2-1ubuntu2.21) ... Removing php8.1-opcache (8.1.2-1ubuntu2.21) ... Removing php8.1-readline (8.1.2-1ubuntu2.21) ... Removing php8.1-common (8.1.2-1ubuntu2.21) ... Removing php-common (2:92ubuntu1) ... Warning: Stopping phpsessionclean.service, but it can still be activated by: phpsessionclean.timer Processing triggers for man-db (2.10.2-1) ... (Reading database ... 286459 files and directories currently installed.) Purging configuration files for libapache2-mod-php7.4 (8.1.2-1ubuntu2.21) ... Purging configuration files for php7.4-gmp (7.4.3-4ubuntu2.29) ... Purging configuration files for php-common (2:92ubuntu1) ... Purging configuration files for php-ssh2 (1.3.1+0.13-6) ... Purging configuration files for php-pear (1:1.10.12+submodules+notgz+20210212-1ubuntu3) ... Purging configuration files for php7.4-json (7.4.3-4ubuntu2.29) ... Purging configuration files for php7.4-xml (7.4.3-4ubuntu2.29) ... Purging configuration files for php7.4-common (7.4.3-4ubuntu2.29) ... Purging configuration files for php8.1-bcmath (8.1.2-1ubuntu2.21) ... Purging configuration files for php7.4-curl (7.4.3-4ubuntu2.29) ... Purging configuration files for php-apcu-bc (1.0.5-2build1) ... dpkg: warning: while removing php-apcu-bc, directory '/etc/php/7.4/mods-available' not empty so not removed Purging configuration files for php7.4-mysql (7.4.3-4ubuntu2.29) ... Purging configuration files for php7.4-fpm (7.4.3-4ubuntu2.29) ... apache2_invoke php7.4-fpm postrm: No action required Purging configuration files for php8.1-gmp (8.1.2-1ubuntu2.21) ... Purging configuration files for php7.4-cgi (7.4.3-4ubuntu2.29) ... apache2_invoke php7.4-cgi postrm: No action required Purging configuration files for php8.1-bz2 (8.1.2-1ubuntu2.21) ... Purging configuration files for php8.1-mbstring (8.1.2-1ubuntu2.21) ... Purging configuration files for php8.1-common (8.1.2-1ubuntu2.21) ... Purging configuration files for php7.4-bcmath (7.4.3-4ubuntu2.29) ... Purging configuration files for php8.1-imap (8.1.2-1ubuntu2.21) ... Purging configuration files for php8.1-gd (8.1.2-1ubuntu2.21) ... Purging configuration files for php8.1-phpdbg (8.1.2-1ubuntu2.21) ... Purging configuration files for php7.4-imap (7.4.3-4ubuntu2.29) ... Purging configuration files for php7.4-readline (7.4.3-4ubuntu2.29) ... Purging configuration files for php7.4-mbstring (7.4.3-4ubuntu2.29) ... Purging configuration files for php7.4-bz2 (7.4.3-4ubuntu2.29) ... Purging configuration files for php7.4-cli (7.4.3-4ubuntu2.29) ... dpkg: warning: while removing php7.4-cli, directory '/etc/php/7.4' not empty so not removed Purging configuration files for php7.4-intl (7.4.3-4ubuntu2.29) ... Purging configuration files for php8.1-curl (8.1.2-1ubuntu2.21) ... Purging configuration files for php8.1-xml (8.1.2-1ubuntu2.21) ... Purging configuration files for php8.1-fpm (8.1.2-1ubuntu2.21) ... apache2_invoke php8.1-fpm postrm: No action required Purging configuration files for php7.4-zip (7.4.3-4ubuntu2.29) ... Purging configuration files for php8.1-mysql (8.1.2-1ubuntu2.21) ... Purging configuration files for php8.1-cli (8.1.2-1ubuntu2.21) ... Purging configuration files for php-apcu (5.1.21+4.0.11-7ubuntu1) ... Purging configuration files for php8.1-zip (8.1.2-1ubuntu2.21) ... Purging configuration files for php8.1-redis (5.3.5+4.3.0-5.1) ... Purging configuration files for php7.4-ldap (7.4.3-4ubuntu2.29) ... Purging configuration files for php8.1-igbinary (3.2.6+2.0.8-7ubuntu1) ... Purging configuration files for php-igbinary (3.2.6+2.0.8-7ubuntu1) ... Purging configuration files for php8.1-ssh2 (1.3.1+0.13-6) ... Purging configuration files for php7.4-opcache (7.4.3-4ubuntu2.29) ... Purging configuration files for php8.1-readline (8.1.2-1ubuntu2.21) ... Purging configuration files for libapache2-mod-php8.1 (8.1.2-1ubuntu2.21) ... apache2_invoke php8.1 postrm: No action required Purging configuration files for php8.1-imagick (3.6.0-4ubuntu1) ... Purging configuration files for php8.1-cgi (8.1.2-1ubuntu2.21) ... apache2_invoke php8.1-cgi postrm: No action required Purging configuration files for php-imagick (3.6.0-4ubuntu1) ... Purging configuration files for php-redis (5.3.5+4.3.0-5.1) ... Purging configuration files for php8.1-opcache (8.1.2-1ubuntu2.21) ... Purging configuration files for php8.1-intl (8.1.2-1ubuntu2.21) ... Purging configuration files for php7.4-gd (7.4.3-4ubuntu2.29) ... Purging configuration files for php8.1-apcu (5.1.21+4.0.11-7ubuntu1) ... dpkg: warning: while removing php8.1-apcu, directory '/etc/php/8.1/mods-available' not empty so not removed Purging configuration files for php8.1-ldap (8.1.2-1ubuntu2.21) ...
Note that in the official ownCloud server documentation, it indicates that after the previous step to remove the packages, the "/etc/php" directory should be empty, but it wasn't the case for my testing.
ls /etc/php
root@oclongtermtest:~# ls -l /etc/php total 4 drwxr-xr-x 3 root root 4096 Jun 26 16:45 7.4
add-apt-repository ppa:ondrej/php
root@oclongtermtest:~# add-apt-repository ppa:ondrej/php PPA publishes dbgsym, you may need to include 'main/debug' component Repository: 'deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy main' Description: Co-installable PHP versions: PHP 5.6, PHP 7.x, PHP 8.x and most requested extensions are included. Packages are provided for *Current* Ubuntu *LTS* releases (https://wiki.ubuntu.com/Releases). Expanded Security Maintenance releases ARE NOT supported. Debian stable, oldstable and Debian LTS packages are provided from a separate repository: https://deb.sury.org/#debian-dpa You can get more information about the packages at https://deb.sury.org BUGS&FEATURES: This PPA has a issue tracker: https://deb.sury.org/#bug-reporting Issues reported in a private email don't scale and most likely will be ignored. I simply don't have capacity to answer questions privately. CAVEATS: 1. If you are using apache2, you are advised to add ppa:ondrej/apache2 2. If you are using nginx, you are advised to add ppa:ondrej/nginx DONATION: If you like my work and you want to show appreciation, please consider donating regularly: https://donate.sury.org/ COMMERCIAL SUPPORT: Support for PHP packages for older Debian and Ubuntu release can be bought from https://www.freexian.com/lts/php/ WARNING: add-apt-repository is broken with non-UTF-8 locales, see https://github.com/oerdnj/deb.sury.org/issues/56 for workaround: # LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php More info: https://launchpad.net/~ondrej/+archive/ubuntu/php Adding repository. Press [ENTER] to continue or Ctrl-c to cancel. Adding deb entry to /etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list Adding disabled deb-src entry to /etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list Adding key to /etc/apt/trusted.gpg.d/ondrej-ubuntu-php.gpg with fingerprint B8DC7E53946656EFBCE4C1DD71DAEAAB4AD4CAB6 Hit:1 http://gb.archive.ubuntu.com/ubuntu jammy InRelease Get:2 http://gb.archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB] Hit:3 http://gb.archive.ubuntu.com/ubuntu jammy-backports InRelease Get:4 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy InRelease [24.6 kB] Get:5 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB] Get:6 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main i386 Packages [37.2 kB] Get:7 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 Packages [138 kB] Get:8 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main Translation-en [43.7 kB] Get:9 http://security.ubuntu.com/ubuntu jammy-security/main i386 Packages [659 kB] Get:10 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [2,422 kB] Get:11 http://security.ubuntu.com/ubuntu jammy-security/main Translation-en [365 kB] Get:12 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [3,601 kB] Get:13 http://security.ubuntu.com/ubuntu jammy-security/restricted Translation-en [648 kB] Get:14 http://security.ubuntu.com/ubuntu jammy-security/universe i386 Packages [664 kB] Get:15 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [981 kB] Get:16 http://security.ubuntu.com/ubuntu jammy-security/universe Translation-en [212 kB] Fetched 10.1 MB in 2s (4,382 kB/s) Reading package lists... Done
apt-get update
apt-get -V upgrade
apt-get -V install php7.4 php7.4-intl php7.4-mysql php7.4-mbstring php7.4-imagick php7.4-igbinary php7.4-gmp php7.4-bcmath php7.4-curl php7.4-gd php7.4-zip php7.4-imap php7.4-ldap php7.4-bz2 php7.4-ssh2 php7.4-common php7.4-json php7.4-xml php7.4-dev php7.4-apcu php7.4-redis libsmbclient-dev php-phpseclib
root@oclongtermtest:~# apt-get -V install php7.4 php7.4-intl php7.4-mysql php7.4-mbstring php7.4-imagick php7.4-igbinary php7.4-gmp php7.4-bcmath php7.4-curl php7.4-gd php7.4-zip php7.4-imap php7.4-ldap php7.4-bz2 php7.4-ssh2 php7.4-common php7.4-json php7.4-xml php7.4-dev php7.4-apcu php7.4-redis libsmbclient-dev php-phpseclib Reading package lists... Done Building dependency tree... Done Reading state information... Done libsmbclient-dev is already the newest version (2:4.15.13+dfsg-0ubuntu1.6). The following packages were automatically installed and are no longer required: libffi7 (3.3-5ubuntu1) linux-headers-5.15.0-139 (5.15.0-139.149) linux-headers-5.15.0-139-generic (5.15.0-139.149) linux-image-5.15.0-139-generic (5.15.0-139.149) linux-modules-5.15.0-139-generic (5.15.0-139.149) linux-modules-extra-5.15.0-139-generic (5.15.0-139.149) Use 'apt autoremove' to remove them. The following additional packages will be installed: libapache2-mod-php7.4 (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php-common (2:96+ubuntu22.04.1+deb.sury.org+1) php-pear (1:1.10.16+submodules+notgz-2+ubuntu22.04.1+deb.sury.org+1) php7.4-cli (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-opcache (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-readline (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) pkg-php-tools (1.42build1) Suggested packages: php-libsodium php-mcrypt (3:1.0.7-5+ubuntu22.04.1+deb.sury.org+1) dh-php (5.10+ubuntu22.04.1+deb.sury.org+1) dh-make (2.202102) The following NEW packages will be installed libapache2-mod-php7.4 (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php-common (2:96+ubuntu22.04.1+deb.sury.org+1) php-pear (1:1.10.16+submodules+notgz-2+ubuntu22.04.1+deb.sury.org+1) php-phpseclib (2.0.36-1) php7.4 (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-apcu (5.1.24-1+ubuntu22.04.1+deb.sury.org+1) php7.4-bcmath (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-bz2 (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-cli (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-common (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-curl (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-dev (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-gd (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-gmp (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-igbinary (3.2.16-3+ubuntu22.04.1+deb.sury.org+1) php7.4-imagick (3.8.0-1+ubuntu22.04.1+deb.sury.org+1) php7.4-imap (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-intl (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-json (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-ldap (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-mbstring (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-mysql (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-opcache (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-readline (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-redis (6.2.0-1+ubuntu22.04.1+deb.sury.org+1) php7.4-ssh2 (1.4.1-4+ubuntu22.04.1+deb.sury.org+1) php7.4-xml (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) php7.4-zip (1:7.4.33-20+ubuntu22.04.1+deb.sury.org+1) pkg-php-tools (1.42build1) 0 to upgrade, 29 to newly install, 0 to remove and 0 not to upgrade. Need to get 6,612 kB of archives. After this operation, 31.3 MB of additional disk space will be used. Do you want to continue? [Y/n] y
Note that the above command installed the php-pear package. Any official documentation, it says that you have two go through a set of steps to upgrade to the latest stable version of that package. However, the latest stable version is installed anyway, so I don't believe there is any further steps to be taken.
update-alternatives --config php
php -v
root@oclongtermtest:~# update-alternatives --config php There is only one alternative in link group php (providing /usr/bin/php): /usr/bin/php7.4 Nothing to configure. root@oclongtermtest:~# php -v PHP 7.4.33 (cli) (built: May 9 2025 06:44:39) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
systemctl start apache2
systemctl status apache2
root@oclongtermtest:~# systemctl start apache2 root@oclongtermtest:~# systemctl status apache2 ● apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2025-06-26 17:01:46 BST; 8min ago Docs: https://httpd.apache.org/docs/2.4/ Process: 34479 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS) Main PID: 34483 (apache2) Tasks: 6 (limit: 2154) Memory: 25.0M CPU: 154ms CGroup: /system.slice/apache2.service ├─34483 /usr/sbin/apache2 -k start ├─34487 /usr/sbin/apache2 -k start ├─34488 /usr/sbin/apache2 -k start ├─34489 /usr/sbin/apache2 -k start ├─34490 /usr/sbin/apache2 -k start └─34491 /usr/sbin/apache2 -k start Jun 26 17:01:46 oclongtermtest systemd[1]: Starting The Apache HTTP Server... Jun 26 17:01:46 oclongtermtest systemd[1]: Started The Apache HTTP Server.
echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/server:/10/Ubuntu_22.04/ /' | tee /etc/apt/sources.list.d/isv:ownCloud:server:10.list
curl -fsSL https://download.opensuse.org/repositories/isv:ownCloud:server:10/Ubuntu_22.04/Release.key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/isv_ownCloud_server_10.gpg > /dev/null
apt-get update
apt-get -V upgrade
apt-key list
root@oclongtermtest:~# apt-key list Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). /etc/apt/trusted.gpg.d/isv_ownCloud_server_10.gpg ------------------------------------------------- pub rsa2048 2016-09-25 [SC] [expires: 2026-10-14] 1B07 204C D71B 690D 409F 57D2 4ABE 1AC7 557B EFF9 uid [ unknown] isv:ownCloud OBS Project <isv:ownCloud@build.opensuse.org> /etc/apt/trusted.gpg.d/ondrej-ubuntu-php.gpg -------------------------------------------- pub rsa4096 2024-04-24 [SC] B8DC 7E53 9466 56EF BCE4 C1DD 71DA EAAB 4AD4 CAB6 uid [ unknown] Launchpad PPA for Ondřej Surý /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg ------------------------------------------------------ pub rsa4096 2012-05-11 [SC] 8439 38DF 228D 22F7 B374 2BC0 D94A A3F0 EFE2 1092 uid [ unknown] Ubuntu CD Image Automatic Signing Key (2012) <cdimage@ubuntu.com> /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg ------------------------------------------------------ pub rsa4096 2018-09-17 [SC] F6EC B376 2474 EDA9 D21B 7022 8719 20D1 991B C93C uid [ unknown] Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>
Following all of the previous steps, we are once again successfully able to log into our ownCloud server.