Raspberry Pi Boot Without SD Card: USB SSD and PXE Network Boot
A Raspberry Pi can load its whole operating system from another computer on the network and run with no SD card or SSD in day-to-day use. This Raspberry Pi boot without SD card setup keeps the boot files and system on a central server, which pays off especially if you run several Pis. First you’ll work out which option suits you, then you’ll set up a Raspberry Pi as the server step by step and start a Pi 4 or Pi 5 over Ethernet.
In short
For a single Pi, a USB SSD or NVMe drive is the easiest option. Several Pis can boot over the network if a second Raspberry Pi provides the boot files and operating system.
- What you need for network boot: one Pi as the server, a Pi 4 or Pi 5 as the client, network cables and an SD card for the one-time setup.
- Limitation: network boot only works through the built-in Ethernet port, not over Wi-Fi.
- Day to day: the client depends on the server at all times, because that is where its system lives.
PXE (Preboot Execution Environment) lets a computer reach the network before any operating system is running and fetch its boot files from a server. The Raspberry Pi 4 and Pi 5 support this in their bootloader, the startup software stored on the board.
Which Option Is Right for You?
Network boot takes the most work, so check first whether you really need it:
| Your situation | Best option | Guide |
|---|---|---|
| One Pi that should run faster and more reliably | USB SSD or NVMe | Raspberry Pi USB boot |
| Pi 5 with NVMe, but no SD card for the setup | Flash the NVMe over USB-C | Pi 5 without an SD card |
| Several Pis managed from one place, or Pis with no storage of their own | Network boot | This guide, from “How Network Boot Works” |
Looking for PiServer? The tool is outdated. You’ll find the background under “What About PiServer and netboot.xyz?”.
The Simple Option: Boot From a USB SSD or NVMe
You can skip the server entirely by writing the system straight to a fast drive. In Raspberry Pi Imager, choose a USB SSD such as the Samsung T7* as the storage device. On a Pi 5 you can also use an NVMe SSD in the M.2 HAT*.
The boot order stored in the bootloader decides which device the Pi tries first. The value is read from right to left: by default, the Pi 4 uses 0xf41 (SD card, then USB) and the Pi 5 uses 0xf461 (SD card, NVMe, then USB). The table under “Prepare the Client” explains the digits. With no SD card inserted, the Pi boots from the SSD, so you usually don’t need to change anything. Our USB boot guide has the full details, including older models. If this is the route you’re taking, you’re done here. The rest of this guide covers network boot only.
How Network Boot Works
Three services work together at startup. Knowing the order helps later on, because it also tells you where to look when something fails:
- DHCP: the client’s bootloader asks the network for an IP address, which comes from your router as usual. Our server also replies and says where the boot files are. This is called proxy DHCP, and it doesn’t interfere with your router.
- TFTP: using this simple transfer protocol, the client downloads the firmware, the kernel and the boot parameters in
cmdline.txt. - NFS: the kernel mounts the actual operating system as a network share, so all of the client’s files live on the server.
What You Need
- Server: a Raspberry Pi 4 or Pi 5* running Raspberry Pi OS (64-bit), connected by Ethernet. We copy its system for the client, so it needs to be a Raspberry Pi. The server and client can be different models, because the system includes the kernels for both the Pi 4 and Pi 5.
- Client: a second Pi 4 or Pi 5 with a suitable power supply*.
- SD card: a microSD card* with Raspberry Pi OS for the one-time client setup.
- Network: two Ethernet cables* and free ports on your router or a Gigabit switch*. The server and client must be on the same network.
The commands below use these example values. Swap in the values from your own network, which you’ll look up in the server section. The commands apply to the current Raspberry Pi OS, based on Debian 13, and cat /etc/os-release shows your version:
| Value | Example |
|---|---|
| Server IP address | 192.168.1.100 |
| Router | 192.168.1.1 |
| Network | 192.168.1.0/24 |
| Broadcast address | 192.168.1.255 |
Prepare the Client
First, tell the client to try the network after the SD card and local drives. Boot it once from the SD card, log in with a monitor and keyboard or over SSH, and bring the system and bootloader up to date:
sudo apt update
sudo apt full-upgrade -y
sudo rpi-eeprom-update -a
sudo reboot
After the restart, open the bootloader configuration:
sudo rpi-eeprom-config --edit
Change the BOOT_ORDER line to match your model. In the editor, save with Ctrl+O and Enter, then exit with Ctrl+X. The value is read from right to left:
| Model | Value | Order |
|---|---|---|
| Pi 4 | BOOT_ORDER=0xf241 | SD card (1), USB (4), network (2), start over (f) |
| Pi 5 | BOOT_ORDER=0xf2461 | SD card (1), NVMe (6), USB (4), network (2), start over (f) |
Restart with sudo reboot so the value is written to the bootloader, then check it:
vcgencmd bootloader_config | grep BOOT_ORDER
Also make a note of the serial number and MAC address. The MAC address lets you spot the client in the logs later, and you’ll need the serial number if you add more Pis:
grep Serial /proc/cpuinfo | cut -d ' ' -f 2 | cut -c 9-16
ip -br link
Shut the client down with sudo poweroff and remove the SD card. As long as it’s inserted, the client keeps booting from it. That’s also your way back: put an SD card in and the Pi runs from it again, just like before.
Prepare the Server
All remaining steps happen on the server, again with a monitor and keyboard or over SSH. It needs a fixed IP address, because the client will look for it at exactly that address. Start by checking your current network settings:
nmcli -f NAME,DEVICE connection show
ip -4 addr show
ip route | grep default
The first command shows the name of the wired connection. In the second, find your Ethernet port, which is the entry from the DEVICE column of the first command, usually eth0 or end0. There, the current address follows inet and the broadcast address follows brd. An address of 192.168.1.50/24 means your network is 192.168.1.0/24. The third shows your router after via. The easiest option is to reserve the address for the server in your router. Alternatively, set it on the Pi and pick an address your router doesn’t hand out itself. Replace every example value in the command: the connection name, the server address and both router addresses. Wrong values will cut the Pi off from the network:
sudo nmcli connection modify "Wired connection 1" ipv4.method manual ipv4.addresses 192.168.1.100/24 ipv4.gateway 192.168.1.1 ipv4.dns 192.168.1.1
sudo nmcli connection up "Wired connection 1"
If the address changes, any open SSH session will drop, so reconnect to the new address. If you can’t reach the Pi any more, connect a monitor and keyboard and switch back to an automatic address:
sudo nmcli connection modify "Wired connection 1" ipv4.method auto ipv4.addresses "" ipv4.gateway "" ipv4.dns ""
sudo nmcli connection up "Wired connection 1"
Then update the system and install rsync:
sudo apt update
sudo apt full-upgrade -y
sudo apt install -y rsync
Create the Client’s Root Filesystem
The client gets a copy of the server’s system in the /nfs/client1 folder, and its hostname will be pi-client1. Check the space first: the “Avail” value in the first output must be larger than the size shown by the second:
df -h /
sudo du -xsh /
--exclude /nfsThe destination sits inside the source. Without this exclusion, rsync keeps copying the copied files into themselves until the disk is full.
Then create the copy. The -a option keeps permissions and ownership, and -x stays on the system drive, so /proc, /sys and the boot partition aren’t copied:
sudo mkdir -p /nfs/client1
sudo rsync -xa --progress --exclude /nfs / /nfs/client1
The copy also includes the server’s SSH keys. To give each device its own keys, switch into the new system:
cd /nfs/client1
sudo mount --bind /dev dev
sudo mount --bind /sys sys
sudo mount --bind /proc proc
sudo chroot .
Your prompt now belongs to the client system. Generate new keys there, then leave it:
rm /etc/ssh/ssh_host_*
dpkg-reconfigure openssh-server
exit
Back on the server, undo the bind mounts:
sudo umount dev sys proc
cd
Finally, remove everything that would make the client look like the server:
sudo sed -i "s/$(hostname)/pi-client1/g" /nfs/client1/etc/hosts
echo pi-client1 | sudo tee /nfs/client1/etc/hostname
sudo truncate -s 0 /nfs/client1/etc/machine-id
sudo sh -c 'rm -f /nfs/client1/etc/NetworkManager/system-connections/* /nfs/client1/etc/netplan/*.yaml'
sudo mkdir -p /nfs/client1/etc/cloud && sudo touch /nfs/client1/etc/cloud/cloud-init.disabled
sedandteename the clientpi-client1.truncateclears the machine ID, and the system creates a new one at startup.rm -fdeletes the copied network profiles. Otherwise the client would take on the server’s fixed IP address and any saved Wi-Fi logins.touchdisables cloud-init. Raspberry Pi Imager uses it to set up the first boot, and the client doesn’t need it.
Set Up dnsmasq and TFTP
dnsmasq handles both proxy DHCP and TFTP. Install it, create the TFTP directory and copy in the boot files. The last command opens a new configuration file:
sudo apt install -y dnsmasq
sudo mkdir -p /tftpboot
sudo cp -r /boot/firmware/* /tftpboot/
sudo nano /etc/dnsmasq.d/pxe.conf
Add these lines, replacing 192.168.1.255 with the broadcast address you noted after brd earlier. port=0 turns off the DNS function, which isn’t needed here:
port=0
dhcp-range=192.168.1.255,proxy
log-dhcp
enable-tftp
tftp-root=/tftpboot
pxe-service=0,"Raspberry Pi Boot"
Save the file with Ctrl+O and Enter, exit the editor with Ctrl+X and start the service:
sudo systemctl enable dnsmasq
sudo systemctl restart dnsmasq
Next, the server shares the client’s filesystem and the boot files. Install the NFS server and open the list of shares:
sudo apt install -y nfs-kernel-server
sudo nano /etc/exports
Add these two lines, using your own network:
/nfs/client1 192.168.1.0/24(rw,sync,no_subtree_check,no_root_squash)
/tftpboot 192.168.1.0/24(rw,sync,no_subtree_check,no_root_squash)
The client needs the no_root_squash option so that its root user can work on its own system. It also allows root access to the share, so always limit these lines to your own network rather than using *. Save the file, start the services and check the shares:
sudo systemctl enable rpcbind nfs-kernel-server
sudo systemctl restart rpcbind nfs-kernel-server
sudo exportfs -ra
sudo exportfs -v
The last command should list both directories.
Edit cmdline.txt and fstab
Two files still point to the server’s local drive. The cmdline.txt file tells the kernel where to find the system, so open it first:
sudo nano /tftpboot/cmdline.txt
Replace everything in it with this single line, using your server’s IP address. The file must not contain any line breaks:
console=serial0,115200 console=tty1 root=/dev/nfs nfsroot=192.168.1.100:/nfs/client1,vers=3 rw ip=dhcp rootwait
The /etc/fstab file lists the drives the system mounts at startup. In the copy on the server, remove the local entries and mount the boot files over NFS instead:
sudo sed -i '/PARTUUID=/d' /nfs/client1/etc/fstab
echo "192.168.1.100:/tftpboot /boot/firmware nfs defaults,vers=3 0 0" | sudo tee -a /nfs/client1/etc/fstab
cat /nfs/client1/etc/fstab
You should be left with the proc line and the new NFS line. If there’s still an entry with /dev/mmcblk0p, delete that too. Only run these commands once, or you’ll end up with a duplicate NFS line.
First Boot and Checks
On the server, watch the dnsmasq log:
journalctl -u dnsmasq -f
Connect the client to the network and power, without the SD card. After a few seconds, its MAC address should show up in the log, followed by lines like sent /tftpboot/… for each transferred file. A connected monitor also shows the bootloader status. The first boot can take around a minute. A few lines with file … not found are normal. If the boot gets stuck, see the table under “Troubleshooting”.
You’ll find the client’s IP address in your router. If you can’t get into the router, try the name pi-client1.local. The username and password are the same as on the server. Log in over SSH and check where the system is coming from:
findmnt /
If everything worked, the SOURCE column shows 192.168.1.100:/nfs/client1.
Add More Pis
Each client needs its own root filesystem, because two systems can’t write to the same files at once. For boot files, the bootloader looks for a folder named after its serial number first and only falls back to the main directory if there isn’t one. Prepare the new Pi as described in “Prepare the Client”. You can reuse the same SD card. Then shut down client1 so no files change during the copy. The new system will include everything you’ve installed on client1. Replace the example serial number 12345678 with the one from your new Pi:
sudo rsync -xa --progress /nfs/client1/ /nfs/client2/
sudo mkdir /tftpboot/12345678
sudo cp -r /boot/firmware/* /tftpboot/12345678/
sudo cp /tftpboot/cmdline.txt /tftpboot/12345678/
sudo sed -i 's#/nfs/client1#/nfs/client2#' /tftpboot/12345678/cmdline.txt
sudo sed -i 's#:/tftpboot #:/tftpboot/12345678 #' /nfs/client2/etc/fstab
The last two lines point cmdline.txt and fstab at the new client. Now give it its own name, a new machine ID and its own SSH keys:
sudo sed -i 's/pi-client1/pi-client2/g' /nfs/client2/etc/hosts /nfs/client2/etc/hostname
sudo truncate -s 0 /nfs/client2/etc/machine-id
sudo sh -c 'rm -f /nfs/client2/etc/NetworkManager/system-connections/*'
cd /nfs/client2
sudo mount --bind /dev dev
sudo mount --bind /sys sys
sudo mount --bind /proc proc
sudo chroot . sh -c 'rm /etc/ssh/ssh_host_*; dpkg-reconfigure openssh-server'
sudo umount dev sys proc
cd
Finally, share the new copy over NFS, again using your own network. Only run this once:
echo "/nfs/client2 192.168.1.0/24(rw,sync,no_subtree_check,no_root_squash)" | sudo tee -a /etc/exports
sudo exportfs -ra
Start the new Pi without an SD card and check it with findmnt /, which should now show /nfs/client2. You can switch client1 back on. For each additional Pi, repeat the steps with client3 and its serial number. One word of caution: a Pi without its own folder loads the boot files from the main directory, which means it uses the system of client1. Don’t start it until its folder exists.
Troubleshooting
| Problem | Solution |
|---|---|
| The Pi doesn’t try to boot from the network | Make sure the SD card is out and the cable is in the built-in Ethernet port. If it still doesn’t work, boot once from the SD card and check the boot order with vcgencmd bootloader_config. |
| Nothing appears in the dnsmasq log | Check the cable and network, and compare the broadcast address in pxe.conf. The Raspberry Pi documentation also mentions STP as a possible cause, a feature on some switches that prevents network loops. Try turning it off. |
The log shows file … not found | Check that the boot files are in /tftpboot. A few of these messages are normal, because the bootloader tries the serial number folder first. |
| The kernel starts but can’t find its system | Check the IP address and path in cmdline.txt, and make sure it’s a single line. On the server, run sudo exportfs -v and systemctl status nfs-kernel-server rpcbind. |
| The client gets the server’s IP address | The copied network profiles weren’t deleted. Shut down the client, run the rm -f line from the root filesystem section on the server (with the matching path for additional Pis), then start the client again. |
| The client freezes when the server restarts | That’s expected, because its system lives on the server. Keep the server running at all times. |
What About PiServer and netboot.xyz?
PiServer was a graphical tool from the Raspberry Pi Foundation that set up DHCP, TFTP and NFS for you. Its last release came out in May 2023, and the package is no longer in the current Raspberry Pi OS repository, so it’s no longer an option for new installs.
netboot.xyz is a boot menu that loads installers and systems from the internet. For the Raspberry Pi, it only offers Pi 4 images, which you start from an SD card or USB drive yourself. It doesn’t replace your own server with a permanent system for your Pis.
Frequently Asked Questions
No. The Raspberry Pi can only boot from the network through its built-in Ethernet port.
No. dnsmasq runs as proxy DHCP here. Your router still assigns the IP addresses, and the server only provides the boot information.
No. You only need the SD card once per Pi to change its boot order. After that, the slot stays empty.
Yes, but the client setup is different. The Pi 3B+ supports network boot out of the box, while the Pi 3B needs it enabled once. The official documentation covers the steps.
You update the client with apt as usual. Because /boot/firmware is mounted over NFS, new boot files go straight into the server’s TFTP directory. Updates on the server itself don’t change the client systems.
Conclusion
For a single Pi, an SSD is still the easier choice. Network boot comes into its own once you run several Pis from one place: their systems sit in folders under /nfs on the server, so a single backup of that folder covers every client. For more background, see the official documentation. Have fun trying it out!
