Installing Ubuntu Server on a Raspberry PI 4 with an external SSD
My preferred home server is a Raspberry Pi 4 running Ubuntu Server using an external USB SSD drive - here is how I get it running on the network.

My preferred home server is a Raspberry Pi 4 Model B with 4 or 8Gb of RAM. It's affordable, supports a PoE hat, is stackable, works well with a cased external SSD, and runs Ubuntu Server.
You will need
- A Raspberry Pi 4, an SSD drive and USB enclosure, and a microSD card.
- A laptop or desktop computer with an SD card slot and Raspberry Pi Imager installed.
Set the Pi to boot from an external SSD
The first task is to make sure the Pi has USB boot enabled.
Insert the microSD card into your computer and open Raspberry Pi Imager. Select Raspberry Pi 4
as the Raspberry Pi device by clicking Choose Device
under the Raspberry Pi Device
heading.

Then, under Operating System
, find Misc utility images > Bootloader (Pi 4 family) > USB Boot
and select it.

Finally, select your microSD card as the Storage
option.
When ready, click the Next
button and write the image to the microSD card.
Once complete remove the microSD card from your computer and insert it into the Raspberry Pi. Power up the Pi and after a few seconds you will see the green light on the front flash steadily to indicate the settings have been updated.
Turn off the Pi and remove the microSD card - it is no longer needed and should not be left inside the Pi.
Install Ubuntu on the SSD drive
Returning to your computer, put the SSD drive into its enclosure and plug it into your computer's USB port. It will appear like any other external hard drive.
Back in Raspberry Pi Imager, with the Raspberry Pi Device
set to Raspberry Pi 4
, select the Ubuntu operating system you want to install under Operating System
. You can find all the Ubuntu images under Other general-purpose OS > Ubuntu
. At the time of writing the image I use is Ubuntu Server 24.04.2 LTS (64-bit)
but you should choose the latest 64-bit OS server image that has LTS (Long Term Support).
Select your SSD drive in the Storage
option and hit the Next
button.

In the OS customisations dialogue that appears, select Edit Settings
. Here you can set the server's hostname, the default username and password for the initial user, and the locale settings for your new server.

Set the hostname and fill in the initial username and password that you want to use. Here we are using batman
as the hostname, and phil
as the default username.
Under the Services
tab you should also enable ssh with password authentication. If you already have ssh keys you can add your public key here if you prefer.

Save
the settings and write the image with your chosen settings to the SSD drive by choosing Yes
to apply them, and then again Yes
to start writing.

Once complete, close the Raspberry Pi Imager and eject the SSD drive from your computer.
Adding a domain
If you have a public domain name registered, or you are using an internal DNS with a domain, you can set the full domain name for your new server by adding it to the config file for Ubuntu before we boot the Pi.
To do so, plug the SSD drive back into your computer so it reappears on your desktop as system-boot
. Edit the file user-data
on the SSD with a text editor (TextEdit on a Mac will do, as will vi from the terminal, Notepad on a PC). Add a line with your fully qualified domain name fqdn
to the top of the file:
#cloud-config
hostname: batman
fqdn: batman.little.place
manage_etc_hosts: true
Here the hostname is batman
and the fully qualified domain name is batman.little.place
- use your hostname and domain name as appropriate.
Save the file and eject the SSD from your computer once done.
Boot the Raspberry Pi
Connect the SSD and the network to the Pi and power it up. If you have a PoE hat, ensure it's properly fitted and your Ethernet cable is providing power. After a few minutes, the Pi should appear on the network with an IP address assigned by your DHCP server (your router unless you have added your own to your local network).
Using a browser on your computer, access the admin pages of your DHCP server (typically your router's admin pages) and log in. Navigate to the DHCP or clients section to find the IP address assigned to the Pi. Set this IP address as a fixed
or reserved
address so the Pi always receives the same IP address from the DHCP server. Most modern routers support this feature, though it might take some time to locate it in the admin pages.
Router | Menu Navigation |
---|---|
UDM Pro | Site Manager > Network > Client Devices hostname > Settings |
HomeHub | My Devices hostname > Change Settings > Always Use This IP Address |
TP Link | Advanced > Network > DHCP Server > Address Reservation > Add Scan > hostname > Add This Entry |
Eero | App > Settings > Network Settings > Reservations & Port Forwarding hostname > Set Address |
If you prefer, you can assign a specific (static) IP address to the Pi outside the DHCP pool range. Just remember to reboot the Pi after making this change so the new address is picked up. If you have VLANs or firewalls, complete the necessary tasks at this point for your particular network setup to place the Pi in the appropriate network location.
If you are running a local DNS server (or using the router as a name server with local records) and using a fully qualified domain name for your server then add the appropriate information to those systems.
Once the Pi is up, you can use SSH from your computer (Windows or Mac Terminal) by typing ssh username@hostname
at the command prompt (replace username
and hostname
with your actual details). You will be prompted by the Pi for the password you set earlier.
If the Pi can't be found, try connecting with ssh username@IP_ADDRESS
, using the IP address assigned by the DHCP server and your chosen username. If everything is set up correctly, you should be able to log in and reach the password prompt on the Pi.
Once all that is done, you can now start configuring the server.