How to Install Latest Apache on Ubuntu
In continuation of the previous post about installing the latest PHP on Ubuntu, a similar approach for installing the Apache web server will be reviewed here.
Again, the same issue exists with the latest Apache version available in the original Ubuntu 24.04 repository, where it is tied to version 2.4.58.
As it is possible to notice when adding the ppa:ondrej/php repository, there is also a similar repository available for Apache. This can be added using a single command.
sudo add-apt-repository ppa:ondrej/apache2
The following output will be shown:
PPA publishes dbgsym, you may need to include 'main/debug' component
Repository: 'Types: deb
URIs: https://ppa.launchpadcontent.net/ondrej/apache2/ubuntu/
Suites: noble
Components: main
'
Description:
This branch follows latest Apache2 packages as maintained by the Debian Apache2 team with couple of compatibility patches on top.
It also includes some widely used Apache 2 modules (if you need some other feel free to send me a request).
IMPORTANT: The <foo>-backports is now required on older Ubuntu releases.
BUGS&FEATURES: This PPA now has a issue tracker: https://deb.sury.org/#bug-reporting
PLEASE READ: If you like my work and want to give me a little motivation, please consider donating: https://deb.sury.org/#donate
More info: https://launchpad.net/~ondrej/+archive/ubuntu/apache2
Adding repository.
Press [ENTER] to continue or Ctrl-c to cancel.
By pressing Enter, the repository will be added.
Alternatively, the repository can be added with the -y parameter without additional confirmation.
sudo add-apt-repository -y ppa:ondrej/apache2
After that, update the package list, which will make the up-to-date Apache version available.
sudo apt update
This will allow you to install the latest available Apache.
sudo apt install apache2
As can be seen from the output, it will install Apache with the needed dependencies.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
apache2-bin apache2-data apache2-utils libapr1t64 libaprutil1-dbd-sqlite3 libaprutil1-ldap libaprutil1t64 liblua5.4-0 ssl-cert
Suggested packages:
apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser
The following NEW packages will be installed:
apache2 apache2-bin apache2-data apache2-utils libapr1t64 libaprutil1-dbd-sqlite3 libaprutil1-ldap libaprutil1t64 liblua5.4-0 ssl-cert
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 2098 kB of archives.
After this operation, 8118 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libapr1t64 amd64 1.7.2-3.1ubuntu0.1 [108 kB]
Get:2 http://archive.ubuntu.com/ubuntu noble/main amd64 libaprutil1t64 amd64 1.6.3-1.1ubuntu7 [91.9 kB]
Get:3 http://archive.ubuntu.com/ubuntu noble/main amd64 libaprutil1-dbd-sqlite3 amd64 1.6.3-1.1ubuntu7 [11.2 kB]
Get:4 http://archive.ubuntu.com/ubuntu noble/main amd64 libaprutil1-ldap amd64 1.6.3-1.1ubuntu7 [9116 B]
Get:5 http://archive.ubuntu.com/ubuntu noble/main amd64 liblua5.4-0 amd64 5.4.6-3build2 [166 kB]
Get:6 http://archive.ubuntu.com/ubuntu noble/main amd64 ssl-cert all 1.1.2ubuntu1 [17.8 kB]
Get:7 https://ppa.launchpadcontent.net/ondrej/apache2/ubuntu noble/main amd64 apache2-bin amd64 2.4.66-1+ubuntu24.04.1+deb.sury.org+3 [1338 kB]
Get:8 https://ppa.launchpadcontent.net/ondrej/apache2/ubuntu noble/main amd64 apache2-data all 2.4.66-1+ubuntu24.04.1+deb.sury.org+3 [165 kB]
Get:9 https://ppa.launchpadcontent.net/ondrej/apache2/ubuntu noble/main amd64 apache2-utils amd64 2.4.66-1+ubuntu24.04.1+deb.sury.org+3 [93.0 kB]
Get:10 https://ppa.launchpadcontent.net/ondrej/apache2/ubuntu noble/main amd64 apache2 amd64 2.4.66-1+ubuntu24.04.1+deb.sury.org+3 [97.9 kB]
Fetched 2098 kB in 1s (1421 kB/s)
Preconfiguring packages ...
Selecting previously unselected package libapr1t64:amd64.
(Reading database ... 74984 files and directories currently installed.)
Preparing to unpack .../0-libapr1t64_1.7.2-3.1ubuntu0.1_amd64.deb ...
Unpacking libapr1t64:amd64 (1.7.2-3.1ubuntu0.1) ...
Selecting previously unselected package libaprutil1t64:amd64.
Preparing to unpack .../1-libaprutil1t64_1.6.3-1.1ubuntu7_amd64.deb ...
Unpacking libaprutil1t64:amd64 (1.6.3-1.1ubuntu7) ...
Selecting previously unselected package libaprutil1-dbd-sqlite3:amd64.
Preparing to unpack .../2-libaprutil1-dbd-sqlite3_1.6.3-1.1ubuntu7_amd64.deb ...
Unpacking libaprutil1-dbd-sqlite3:amd64 (1.6.3-1.1ubuntu7) ...
Selecting previously unselected package libaprutil1-ldap:amd64.
Preparing to unpack .../3-libaprutil1-ldap_1.6.3-1.1ubuntu7_amd64.deb ...
Unpacking libaprutil1-ldap:amd64 (1.6.3-1.1ubuntu7) ...
Selecting previously unselected package liblua5.4-0:amd64.
Preparing to unpack .../4-liblua5.4-0_5.4.6-3build2_amd64.deb ...
Unpacking liblua5.4-0:amd64 (5.4.6-3build2) ...
Selecting previously unselected package apache2-bin.
Preparing to unpack .../5-apache2-bin_2.4.66-1+ubuntu24.04.1+deb.sury.org+3_amd64.deb ...
Unpacking apache2-bin (2.4.66-1+ubuntu24.04.1+deb.sury.org+3) ...
Selecting previously unselected package apache2-data.
Preparing to unpack .../6-apache2-data_2.4.66-1+ubuntu24.04.1+deb.sury.org+3_all.deb ...
Unpacking apache2-data (2.4.66-1+ubuntu24.04.1+deb.sury.org+3) ...
Selecting previously unselected package apache2-utils.
Preparing to unpack .../7-apache2-utils_2.4.66-1+ubuntu24.04.1+deb.sury.org+3_amd64.deb ...
Unpacking apache2-utils (2.4.66-1+ubuntu24.04.1+deb.sury.org+3) ...
Selecting previously unselected package apache2.
Preparing to unpack .../8-apache2_2.4.66-1+ubuntu24.04.1+deb.sury.org+3_amd64.deb ...
Unpacking apache2 (2.4.66-1+ubuntu24.04.1+deb.sury.org+3) ...
Selecting previously unselected package ssl-cert.
Preparing to unpack .../9-ssl-cert_1.1.2ubuntu1_all.deb ...
Unpacking ssl-cert (1.1.2ubuntu1) ...
Setting up ssl-cert (1.1.2ubuntu1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/ssl-cert.service → /usr/lib/systemd/system/ssl-cert.service.
Setting up libapr1t64:amd64 (1.7.2-3.1ubuntu0.1) ...
Setting up liblua5.4-0:amd64 (5.4.6-3build2) ...
Setting up apache2-data (2.4.66-1+ubuntu24.04.1+deb.sury.org+3) ...
Setting up libaprutil1t64:amd64 (1.6.3-1.1ubuntu7) ...
Setting up libaprutil1-ldap:amd64 (1.6.3-1.1ubuntu7) ...
Setting up libaprutil1-dbd-sqlite3:amd64 (1.6.3-1.1ubuntu7) ...
Setting up apache2-utils (2.4.66-1+ubuntu24.04.1+deb.sury.org+3) ...
Setting up apache2-bin (2.4.66-1+ubuntu24.04.1+deb.sury.org+3) ...
Setting up apache2 (2.4.66-1+ubuntu24.04.1+deb.sury.org+3) ...
Enabling module mpm_event.
Enabling module authz_core.
Enabling module authz_host.
Enabling module authn_core.
Enabling module auth_basic.
Enabling module access_compat.
Enabling module authn_file.
Enabling module authz_user.
Enabling module alias.
Enabling module dir.
Enabling module autoindex.
Enabling module env.
Enabling module mime.
Enabling module negotiation.
Enabling module setenvif.
Enabling module filter.
Enabling module deflate.
Enabling module status.
Enabling module reqtimeout.
Enabling conf charset.
Enabling conf localized-error-pages.
Enabling conf other-vhosts-access-log.
Enabling conf security.
Enabling conf serve-cgi-bin.
Enabling site 000-default.
Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /usr/lib/systemd/system/apache2.service.
Processing triggers for ufw (0.36.2-6) ...
Processing triggers for man-db (2.12.0-4build2) ...
Processing triggers for libc-bin (2.39-0ubuntu8.6) ...
Scanning processes...
Scanning linux images...
Running kernel seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
The installed Apache version can be verified with:
apache2 -v
This should display the version information confirming Apache is installed.
Server version: Apache/2.4.66 (Ubuntu)
Server built: 2025-12-05T15:02:28
After installation, the Apache web server will be automatically launched. The status can be checked using systemctl.
sudo systemctl status apache2
This should give output similar to the following:
● apache2.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; preset: enabled)
Active: active (running) since Mon 2025-12-29 09:56:17 UTC; 5min ago
Docs: https://httpd.apache.org/docs/2.4/
Main PID: 3255 (apache2)
Tasks: 55 (limit: 4647)
Memory: 5.3M (peak: 5.5M)
CPU: 38ms
CGroup: /system.slice/apache2.service
├─3255 /usr/sbin/apache2 -k start
├─3257 /usr/sbin/apache2 -k start
└─3258 /usr/sbin/apache2 -k start
Dec 29 09:56:17 web systemd[1]: Starting apache2.service - The Apache HTTP Server...
Dec 29 09:56:17 web apachectl[3254]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'S>
Dec 29 09:56:17 web systemd[1]: Started apache2.service - The Apache HTTP Server.
After installation, Apache can be accessed via the standard HTTP protocol. If installed on localhost, it can be accessed at http://localhost/. If installed on a remote machine, replace localhost with the machine’s IP address or domain name.
By following these steps, the latest Apache version can be installed on an Ubuntu machine using Ondřej Surý’s PPA Apache repository, ensuring you have access to the most recent features and security updates.