Uninstall Chromium
Ungoogled-chromium can conflict with Chromium, so it is recommended to uninstall it first.
sudo snap remove chromium
sudo apt remove chromium-browser
Download ungoogled-chromium
Download the latest ungoogled-chromium from https://ungoogled-software.github.io/ungoogled-chromium-binaries/releases/appimage/64bit/
At the time of writing this, the latest version is 129.0.6668.58-1. I will use this version in the example below, but you have to replace it with what is the latest for you.
mkdir -p ~/Applications
wget -O ~/Applications/ungoogled-chromium.AppImage https://github.com/ungoogled-software/ungoogled-chromium-portablelinux/releases/download/129.0.6668.58-1/ungoogled-chromium_129.0.6668.58-1.AppImage
chmod +x ~/Applications/ungoogled-chromium.AppImage
To run AppImages you may need to install libfuse
sudo apt install libfuse2t64
Create .desktop launcher
You can do this manually or use AppImageLauncher.
For Ubuntu 24.04 the maintainer of AppImageLauncher recommends installing the .deb from the continuous build https://github.com/TheAssassin/AppImageLauncher/releases/tag/continuous.
Replace appimagelauncher_2.2.0-gha111.d9d4c73+bionic_amd64.deb with what is the latest for you.
# Download the pre-compiled .deb build
wget -O appimagelauncher.deb https://github.com/TheAssassin/AppImageLauncher/releases/download/continuous/appimagelauncher_2.2.0-gha111.d9d4c73+bionic_amd64.deb
Install the .deb build
sudo dpkg -i appimagelauncher.deb
Fix dependancy problems if you get errors about missing libraries
sudo apt --fix-broken install -y
May also be needed
sudo systemctl restart systemd-binfmt
Delete the installation file
rm appimagelauncher.deb
Start the ungoogled-chromium.AppImage file and click on Integrate and Run when the AppImageLauncher pops up. This will automatically create the required .desktop file in ~/.local/share/applications. The AppImageLauncher may rename your ungoogled-chromium.AppImage file to something like ungoogled-chromium_fb8ef8b1293fa7f66ca83453aa2da417.AppImage.

Disable AppArmor User Namespace Restrictions
You may need to either globally or selectively disable an Ubuntu security feature. Read more about AppArmor User Namespace Restrictions vs. Chromium Developer Builds in the Chromium Docs. I am using Option 1, the easiest way in my example, but there are other safer ways you can read about in the official documentation.
echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
echo kernel.apparmor_restrict_unprivileged_userns=0 | sudo tee /etc/sysctl.d/60-apparmor-namespace.conf
Associate running instance with the .desktop launcher
You need to add the StartupWMClass to the .desktop file of the launcher of the AppImage. Otherwise your running instance will not get associated with the .desktop launcher.
The .desktop files are located at ~/.local/share/applications. The file you are looking for should look somethinge like this: appimagekit_fb8ef8b1293fa7f66ca83453aa2da417-Chromium__ungoogled_.desktop. Open it and add the following new line after Type=Application:
StartupWMClass=Chromium-browser
Make ungoogled-chromium the default browser
xdg-settings set default-web-browser appimagekit_fb8ef8b1293fa7f66ca83453aa2da417-Chromium__ungoogled_.desktop