Ubuntu MATE GUI and Apache2 on Raspberry Pi

Guide for setting up Ubuntu 24.04 LTS on a Raspberry Pi (4 or 5) with the MATE desktop environment and an Apache2 web server.

Step 1: Download and Flash Ubuntu 24.04 LTS

Download Ubuntu 24.04 LTS for Raspberry Pi (Desktop or Server ARM64), or select it directly inside Raspberry Pi Imager.

Write the image to your microSD card (or USB/NVMe drive) using Raspberry Pi Imager and use OS Customization to pre-configure your hostname, username, password, Wi-Fi, and SSH settings.

Insert the storage media and power on your Raspberry Pi.

Step 2: First Login and Password Setup

Log in via SSH or directly on the Raspberry Pi with the user account configured in Raspberry Pi Imager. If you started from an image with a default password or want to update your account password right away, run passwd:

passwd

Step 3: Update System and Reboot

Update all packages before installing a desktop environment or web server:

sudo apt update
sudo apt full-upgrade -y

Reboot cleanly so any new kernel and firmware updates take effect:

sudo reboot

Step 4: Install the MATE Desktop Environment

If you flashed Ubuntu Server 24.04 LTS (headless) and want to add the MATE GUI, install the official desktop metapackage directly from the Ubuntu repositories:

sudo apt update
sudo apt install -y ubuntu-mate-desktop

(If you flashed Ubuntu Desktop in Step 1 and prefer the standard desktop, you can skip this step. If prompted to choose a display manager during installation, lightdm is a lightweight default for Raspberry Pi hardware.)

Reboot once installation finishes so the graphical login screen starts cleanly:

sudo reboot

Step 5: Install and Configure Apache2 WebServer

Install Apache2 and start the service:

sudo apt update
sudo apt install -y apache2
sudo systemctl enable --now apache2

If UFW firewall is active, allow HTTP and HTTPS traffic:

sudo ufw allow 80,443/tcp

Verify Apache2 is working by opening http://<raspberry-pi-ip> in a browser on your network—you should see the Apache2 default page.

User