Bug Alert!
There is a bug (bug number: 1396379) in the Ubuntu installer that installs the grub bootloader on the first ESP it finds. See https://ubuntuforums.org/showthread.php?t=2182302 for discussions on this.
To workaround this bug you will need to take a few extra steps.
Workaround
- When you boot from the LiveUSB in UEFI mode, use the Try Ubuntu
without Installing option.
- Open the Gparted application when the Ubuntu desktop starts.
- Select the Windows (first) drive within Gparted at the top right
corner(1):

The NVME drive in this picture does not have Windows. However, it has an EFI System Partition (ESP).
- Highlight the ESP in the bottom list of partitions as shown above (2). Right click on the highlighted partition and select Manage Flags from the context menu. You will see:

You should see two flags, boot
and esp
checked. Uncheck those two flags. Click Close button to exit the Manage Flag window. Click the green "Apply" ✅ button if it is clickable.
You will need to restore those check marks once Ubuntu is installed using the same above process so that Windows can boot from the first drive.
Close Gparted.
This is the end of the workaround.
Original Answer
See How do I install Ubuntu to a USB key? (without using Startup Disk Creator)
Even though it is for USB key, the same principle applies for the USB Hard drive. Pay extra attention to the second answer. The relevant parts are noted below:
During install choose "Something Else"

Partition and format the USB drive
After having chosen Something else the graphical partition manager GParted will guide us through the partitioning process:

- At this point take extra care that the boot loader Grub indeed will
be installed to the USB drive (/sda in the picture, but yours will be different) and not to anywhere else
See the bottom of the image above, and make your selection where it says: Device for bootloader installation. The bootloader is another name for the GRUB. It should be installed in the MBR of the external USB hard drive and not in one of its partition.
You will need at least one ext4
partition with a mount point root (/
). In the example above an additional /home
(also ext4
) partition was created. If in the future you need to reinstall Ubuntu, by unticking Format box you can keep the data in /home
partition. You will also want a small swap
partition of 4GB size (not shown in the picture) with no mount point, in its own Linux/Swap format to be used as virtual memory.
hope this helps
Best Answer
I don't know if it's possible to achieve this without it, but I managed to get my Mac to boot Ubuntu from an external hard disk by installing an Refind (a boot manager).
Hope this helps.