Add the Debian installer to our PXE server - cesetxeberria/pxeserver GitHub Wiki

First of all we have to prepare our PXE server using one of these bootloaders

Then as root user install the debian installer files for i386 and amd64. Alternatively, its also possible to download them from here (i386) and here (amd64).

apt-get install debian-installer-11-netboot-i386 debian-installer-11-netboot-amd64

Once downloaded, create a new folder inside the tftp-root and copy all the needed files there.

mkdir -p /home/tftp/installers/debian/amd64
mkdir -p /home/tftp/installers/debian/i386
cp /usr/lib/debian-installer/images/11/amd64/text/debian-installer/amd64/linux /home/tftp/ /home/tftp/installers/debian/amd64/
cp /usr/lib/debian-installer/images/11/amd64/text/debian-installer/amd64/initrd.gz /home/tftp/installers/debian/i386/amd64
cp /usr/lib/debian-installer/images/11/i386/text/debian-installer/i386/linux /home/tftp/installers/debian/i386/
cp /usr/lib/debian-installer/images/11/i386/text/debian-installer/i386/initrd.gz /home/tftp/installers/debian/i386/

Then add the installer entry to your boot menu.

If using pxelinux

nano /home/tftp/syslinux/bios/pxelinux.cfg/default

label Bullseye installer (amd64)
 menu clear
 kernel /installers/debian/amd64/linux
 initrd /installers/debian/amd64/initrd.gz
 append vga=788 --- quiet

label Bullseye installer (i386)
 menu clear
 kernel /installers/debian/i386/linux
 initrd /installers/debian/i386/initrd.gz
 append vga=788 --- quiet

If using grub

nano /home/tftp/grub/grub.cfg

menuentry "Bullseye installer (i386)" {
 set gfxpayload=800x600x16,800x600
 linux /installers/debian/i386/linux --- quiet
 initrd /installers/debian/i386/initrd.gz
}

menuentry "Bullseye installer (amd64)" {
 set gfxpayload=800x600x16,800x600
 linux /installers/debian/amd64/linux --- quiet
 initrd /installers/debian/amd64/initrd.gz
}

If using ipxe

nano /home/tftp/default.ipxe

:debianinstall32
kernel /installers/debian/i386/linux
initrd /installers/debian/i386/initrd.gz
imgargs linux initrd=initrd.gz vga=788
boot ||
goto MENU

:debianinstall64
kernel /installers/debian/amd64/linux
initrd /installers/debian/amd64/initrd.gz
imgargs linux initrd=initrd.gz vga=788
boot ||
goto MENU