Debian 13 can install systemd-boot instead of GRUB, but only from the Expert install mode of the installer. If you already have a normal install with GRUB, you can switch afterwards, and most guides make it look like two commands: apt install systemd-boot and bootctl install.
On a machine with Secure Boot enabled, that is not enough. I did this on a Debian 13 VM (OVMF with the Microsoft keys enrolled) and ran into three problems the short guides skip:
- The boot entry that
bootctlcreates does not boot with Secure Boot on. - The obvious
efibootmgrcommand to fix it silently boots GRUB again. - Installing the package overwrites the fallback boot path with an unsigned loader, which only shows up the day you lose your NVRAM.
This guide covers the full switch, with real output from each step.
What you need to understand first: the Secure Boot chain
With Secure Boot, the firmware only runs EFI programs signed with keys it trusts, and on almost every PC those are Microsoft’s keys. Debian’s GRUB and systemd-boot are signed by Debian, not Microsoft. That is why Debian uses shim: a tiny loader signed by Microsoft that carries Debian’s key inside and then loads the next stage.
firmware -> shim (signed by Microsoft) -> systemd-boot (signed by Debian) -> kernel (signed by Debian)
Keep this chain in mind. Every problem below comes from something trying to skip shim.
The other key difference: GRUB has its own drivers and can read your kernel from /boot on ext4 or LVM. systemd-boot can only read the EFI System Partition (ESP, FAT32). So on Debian, kernel-install copies every kernel and initrd into the ESP, and each menu entry is a small .conf file. There is no update-grub equivalent to run.
Before you start
- The system must boot in UEFI mode. systemd-boot does not support legacy BIOS.
- Check Secure Boot is actually on, so you can compare later:
$ mokutil --sb-state
SecureBoot enabled
- Make a backup or snapshot. If you get the boot entry wrong, the machine will not boot. On a VM, clone it first (I used
virt-clone).
Step 1: Move the kernel command line
With GRUB, kernel parameters live in /etc/default/grub. With systemd-boot, kernel-install reads them from /etc/kernel/cmdline. Get your root filesystem UUID:
$ findmnt -no UUID /
6bb0ca11-xxxx-xxxx-xxxx-648ec36894d9
Create /etc/kernel/cmdline with your editor:
$ sudo nano /etc/kernel/cmdline
root=UUID=6bb0ca11-xxxx-xxxx-xxxx-648ec36894d9 ro quiet
Use your own UUID. If you had extra parameters in GRUB_CMDLINE_LINUX_DEFAULT, add them here too.
Step 2: Install systemd-boot (the signed one)
$ sudo apt install systemd-boot systemd-boot-efi-amd64-signed
systemd-boot-efi-amd64-signed is the build signed by Debian. Without it, shim has nothing it is allowed to load.
The package immediately creates entries for every installed kernel:
$ sudo bootctl list
type: Boot Loader Specification Type #1 (.conf)
title: Debian GNU/Linux 13 (trixie) (6.12.117+deb13-amd64) (default) (not reported/new)
id: <machine-id>-6.12.117+deb13-amd64.conf
source: /boot/efi//loader/entries/<machine-id>-6.12.117+deb13-amd64.conf
linux: /boot/efi//<machine-id>/6.12.117+deb13-amd64/linux
initrd: /boot/efi//<machine-id>/6.12.117+deb13-amd64/initrd.img-6.12.117+deb13-amd64
options: root=UUID=6bb0ca11-xxxx-xxxx-xxxx-648ec36894d9 systemd.machine_id=<machine-id>
...
Check that options contains the UUID from step 1. You may see two entries if you have two kernels installed (for example the one from the ISO and an updated one).
Since kernels now live in the ESP, check there is room. Each kernel plus initrd takes a few tens of MB:
$ df -h /boot/efi
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 758M 116M 642M 16% /boot/efi
Step 3: Fix the boot entry so it goes through shim
When the package installs, bootctl adds a firmware entry called Linux Boot Manager that points straight at systemd-bootx64.efi. With Secure Boot on, the firmware refuses it, because that file is not signed by Microsoft. Find it and delete it:
$ sudo efibootmgr
Look for Linux Boot Manager and note its number (it was 0001 in my case):
$ sudo efibootmgr -b 0001 -B
Now create an entry that loads shim and passes it the path of systemd-boot as an argument. First identify the ESP disk and partition:
$ lsblk -f
NAME FSTYPE FSVER LABEL UUID MOUNTPOINTS
vda
├─vda1 vfat FAT32 D04A-xxxx /boot/efi
├─vda2 ext4 1.0 6bb0ca11-xxxx-xxxx-xxxx-648ec36894d9 /
└─vda3 swap 1 3a3ab77e-xxxx-xxxx-xxxx-d89c33cddf74 [SWAP]
The ESP is vda1, so disk /dev/vda, partition 1:
$ sudo efibootmgr --create --disk /dev/vda --part 1 \
--label "Debian systemd-boot" \
--loader '\EFI\debian\shimx64.efi' \
--unicode '\EFI\systemd\systemd-bootx64.efi \0'
What each option does:
--loader: what the firmware runs, which is shim.--unicode: the argument passed to shim, which is the path of the next loader. If shim receives no argument, it loadsgrubx64.efifrom its own folder.
The gotcha: the trailing \0
My first attempt was the same command without the \0 at the end. The entry was created, the machine rebooted, and GRUB came up. Shim was not picking up the path and fell back to grubx64.efi.
What fixed it was copying exactly how the Debian expert installer writes this entry on a fresh systemd-boot install. Listing that entry with efibootmgr -v shows the argument ends in \0. With it, the new entry looks like this:
Boot0001* Debian systemd-boot HD(1,GPT,...)/File(\EFI\debian\shimx64.efi) File(.\EFI\systemd\systemd-bootx64.efi \0)
The new entry goes first in BootOrder. Leave the old debian entry (shim -> GRUB) in place for now as a way back.
Step 4: Reboot and verify
You should see the systemd-boot menu instead of GRUB. Then:
$ mokutil --sb-state
SecureBoot enabled
$ sudo bootctl status
System:
Firmware: UEFI 2.70 (Debian distribution of EDK II 1.00)
Secure Boot: enabled (user)
Boot into FW: supported
Current Boot Loader:
Product: systemd-boot 257.13-1~deb13u1
...
Loader: └─/EFI/systemd/systemd-bootx64.efi
Current Entry: <machine-id>-6.12.117+deb13-amd64.conf
The two lines that matter: Secure Boot: enabled and Product: systemd-boot.
Step 5: Remove GRUB
GRUB is a protected package in Debian, so apt refuses to remove it normally (a safety net against leaving a system unbootable). Only do this after step 4 worked:
$ sudo apt purge --allow-remove-essential grub-efi-amd64 grub-efi-amd64-signed grub-efi-amd64-bin grub-common grub2-common
REMOVING:
grub-common* grub-efi-amd64-bin* grub-efi-amd64-unsigned* os-prober*
grub-efi-amd64* grub-efi-amd64-signed* grub2-common*
WARNING: The following essential packages will be removed.
...
Read the list before confirming: shim-signed and systemd-boot must not be in it.
$ sudo apt autoremove --purge
...
update-initramfs: Generating /boot/initrd.img-6.12.117+deb13-amd64
Updating kernel version 6.12.117+deb13-amd64 in systemd-boot...
That last line is systemd-boot copying the regenerated initrd into the ESP on its own. This is the job update-grub used to do.
Clean up GRUB leftovers and the old firmware entry. Do not delete the EFI/debian folder: shim lives there.
$ sudo rm /boot/efi/EFI/debian/grubx64.efi
$ sudo rm -r /boot/grub
$ sudo efibootmgr -b 0003 -B
(0003 was my old debian entry; use your number.)
$ dpkg -l | grep grub
$
No output: GRUB is gone.
Step 6: Fix the fallback path (do not skip this)
Firmware has a fallback path, EFI/BOOT/BOOTX64.EFI, which it uses when there is no valid boot entry. That happens more than you think: a firmware reset, a CMOS battery, a VM recreated with a fresh NVRAM.
When you install the systemd-boot package by hand, bootctl replaces that fallback file with unsigned-by-Microsoft systemd-boot. With Secure Boot on, the fallback will not boot. You will not notice until the day your NVRAM is reset. (A fresh install from the expert installer does not have this problem.)
I only found this because I reset the VM’s NVRAM later and it would not boot. Fix it now:
$ sudo cp /boot/efi/EFI/debian/shimx64.efi /boot/efi/EFI/BOOT/BOOTX64.EFI
$ sudo cp /boot/efi/EFI/systemd/systemd-bootx64.efi /boot/efi/EFI/BOOT/grubx64.efi
$ sudo rm /boot/efi/EFI/BOOT/fbx64.efi
Why each line:
- The fallback becomes shim again.
- Shim with no argument loads
grubx64.efifrom its own folder, so we put systemd-boot there under that name. - If
fbx64.efi(shim’s “fallback” helper) is present, shim runs it first, and it would recreate a boot entry pointing at the GRUB you just removed.
I tested it by wiping the NVRAM (virsh start <vm> --reset-nvram). The machine booted through the fallback with Secure Boot still enabled, and I recreated the “Debian systemd-boot” entry with the same efibootmgr --create command from step 3.
Step 7 (optional): Firmware and EFI shell entries
The menu lives in /boot/efi/loader/loader.conf. On Debian 13 the default was already what I wanted:
$ sudo cat /boot/efi/loader/loader.conf
timeout 10
#console-mode keep
default <machine-id>-*
auto-firmware yes
default <machine-id>-*matches only the Debian entries, which all start with the machine ID.auto-firmware yesadds a Reboot Into Firmware Interface entry.
To add an EFI shell, Debian packages it. systemd-boot can only launch files that are inside the ESP, so copy it there:
$ sudo apt install efi-shell-x64
$ sudo mkdir -p /boot/efi/EFI/tools
$ sudo cp /usr/share/efi-shell-x64/shellx64.efi /boot/efi/EFI/tools/shellx64.efi
$ sudo nano /boot/efi/loader/entries/efishell.conf
title EFI Shell
efi /EFI/tools/shellx64.efi
sort-key zz-shell
efiinstead oflinux: it launches an EFI program, not a kernel.sort-key zz-shell: sorts it below Debian.
Expect this to fail with Secure Boot on. shellx64.efi is not signed, so selecting it gives a security violation. That is Secure Boot working as intended. To use the shell, disable Secure Boot temporarily in the firmware settings.
One warning from experience: on OVMF, after I disabled Secure Boot from the firmware menu, the VM lost its enrolled keys (mokutil reported Platform is in Setup Mode) and would not let me re-enable it. The way back was resetting the NVRAM, which is exactly why step 6 matters.
Removing old kernels
If you want a single Debian entry, purge the old kernel package:
$ sudo apt purge linux-image-6.12.107+deb13-amd64
kernel-install also removes its entry and its files from the ESP. If bootctl list still shows it as reported/absent, that is the list from the last boot; it disappears after the next reboot.
Is it worth it?
Pros
- Each entry is a few lines of plain text. There is no generated config.
- Kernel updates add and remove their own entries.
bootctlshows and changes everything (default entry, one-time boot, timeout).- It detects firmware access and other loaders on the ESP automatically.
Cons
- UEFI only.
- No rescue console like GRUB’s.
- On Debian 13 it is still rough when done by hand: the shim entry and the fallback path need manual work, as shown above.
GRUB remains Debian’s default. systemd-boot is the default on distributions such as Pop!_OS and EndeavourOS (UEFI installs).
Quick checklist
/etc/kernel/cmdlinewith your root UUID.apt install systemd-boot systemd-boot-efi-amd64-signed.- Delete “Linux Boot Manager”; create a shim entry with
--unicode '\EFI\systemd\systemd-bootx64.efi \0'. - Reboot, check
bootctl statusandmokutil --sb-state. - Purge GRUB with
--allow-remove-essential, keepEFI/debian. - Restore shim as
EFI/BOOT/BOOTX64.EFI, put systemd-boot asEFI/BOOT/grubx64.efi, removefbx64.efi.