Hi everyone,
I wanted to share a quick solution for an issue I ran into while trying to install HestiaCP on a fresh, fully updated Ubuntu 24.04 LTS VPS with IPv6 enabled.
When running the initial wget command to grab the installer script, the process appeared completely frozen, taking nearly 10 minutes to finish. Checking the terminal output, the system was stubbornly trying to connect via IPv6 first, hitting continuous timeouts before finally falling back to IPv4 to download the file:
Resolving raw.githubusercontent.com… 2606:50c0:8002::154, …
Connecting to raw.githubusercontent.com|2606:50c0:8002::154|:443… failed: Connection timed out.
…
Connecting to raw.githubusercontent.com|185.199.111.133|:443… connected.
HTTP request sent, awaiting response… 200 OK
The Problem on Ubuntu 24.04
Many VPS providers automatically assign an IPv6 subnet (like a /64 block), but if their underlying routing, gateway, or your local NDP (Neighbor Discovery Protocol) isn’t behaving perfectly, Ubuntu 24.04 will still try to treat IPv6 as the primary route.
While wget eventually falls back to IPv4 after a long delay, the actual HestiaCP installer script (hst-install.sh) or apt will likely crash or hang indefinitely later in the process when trying to fetch dependencies from Ubuntu and Hestia mirrors.
The Cleanest Fix (Prioritize IPv4)
Instead of fighting with Netplan or completely disabling IPv6 at the kernel level, the most stable fix on Ubuntu 24.04 is to tell the system’s internet address resolver to prefer IPv4.
1-- Open your network precedence configuration file:
sudo nano /etc/gai.conf
2-- Scroll down and locate the following line (it is usually commented out by default with a `#`): ```text #precedence ::ffff:0:0/96 100
3-- Remove the # to uncomment it:
precedence ::ffff:0:0/96 100
4-- Save and exit (Press Ctrl+O, Enter, then Ctrl+X).
If you run wget again, it will instantly download using IPv4 without any timeouts.