Skip to content

Architecture

PxeLab's system composition, boot flow, and key design decisions.

Docs: Features | Boot Architecture & Diskless | Deployment


Service Architecture

PxeLab is a single binary whose internals are organized per service, coordinated by a service manager:

┌─────────────────────────────────────────────────────┐
│                    PxeLab Binary                     │
├──────────┬──────────┬──────────┬──────────┬─────────┤
│  HTTP    │  DHCP    │  TFTP    │  DNS     │  NFS    │
│  :8080   │  :67     │  :69     │  :53     │  :2049  │
│  TCP     │  UDP     │  UDP     │  UDP     │  TCP    │
├──────────┴──────────┴──────────┴──────────┴─────────┤
│              Service Manager (lifecycle)             │
├─────────────────────────────────────────────────────┤
│  SQLite (pxelab.db)  │  Event Bus  │  Log Bus      │
├─────────────────────────────────────────────────────┤
│              Config (config.yaml)                    │
└─────────────────────────────────────────────────────┘
ServiceDefault portProtocolAuto-startPurpose
HTTP8080TCPWeb UI + API + boot file service
DHCP67UDPper configIP assignment + PXE options
ProxyDHCP4011UDPper configPXE options only (overlay mode)
TFTP69UDPNBP file transfer
DNS53UDPLocal DNS resolution
NFS2049TCPNFSv3 file sharing

Each service starts/stops independently; config changes hot-reload in most cases — no process restart needed.


Two-Stage Network Boot

The PXE ROM is limited, so PxeLab uses a two-stage boot to upgrade it to full-featured iPXE:

Stage 1                           Stage 2
┌─────────────┐   TFTP/HTTP    ┌──────────┐   HTTP     ┌──────────────┐
│  PXE ROM    ├───────────────►│  iPXE    ├───────────►│   Boot Menu  │
│  (BIOS/UEFI)│  undionly.kpxe │  (custom │  /boot/    │  (kernel+initrd│
│             │  /ipxe.efi     │  build)  │  ipxe/     │   /WIM/Chain │
└─────────────┘                │          │  script    │   /Local)    │
                               └──────────┘           └──────────────┘

Stage 1: the client PXE ROM sends a DHCP request → PxeLab responds with IP, next-server, and the NBP file name → the client downloads the NBP (e.g. ipxe.efi) over TFTP and executes it.

Stage 2: iPXE runs its embedded script (dhcpchain http://server:8080/boot/ipxe/script) → fetches the boot menu from PxeLab → the user picks a boot entry (install a system, boot local disk, etc.).

Step-by-step details (PXELinux/GRUB2 compatibility, architecture mapping, sanboot diskless): Boot Architecture & Diskless.


Key Design Decisions

DecisionApproachPayoff
Single binaryGo static build; frontend and boot files embeddedZero dependencies, one file to deploy; upgrades = replace one file, no path/permission issues
Service managerEvery service implements a common lifecycle interfaceIndependent start/stop, graceful shutdown, config hot-reload
Event busServices decouple via publish/subscribe (DHCP leases, boot events, WOL, etc.)Loose coupling, easy extension, auditable logging
Store interfaceData layer is interface-based: SQLite and in-memory implementationsIn-memory for fast isolated tests; SQLite for lightweight reliable production
Dependency injectionAll service dependencies constructed explicitly at the entry pointClear dependency graph, no global singletons, easy testing
Modern frontendReact + CSS variable theming + route-level code splittingDark/light themes across all components, fast first paint

Tech Stack

LayerTechnology
BackendGo 1.25+ (chi router, SQLite/GORM)
FrontendReact 19 + TypeScript + Tailwind CSS 4 + Vite
PackagingGoReleaser (multi-platform binaries)

PxeLab - All-in-one PXE Network Boot Server