Unlock the power of automated installations with a Linux PXE server—save time, boost efficiency, and stay ahead of the curve. Don’t fall behind—set up your PXE environment today! #centlinux #linux #pxe
Table of Contents
What is PXE Server?
PXE (pronounced as pixie) is the abbreviation of Preboot eXecution Environment. It is a standardized specification of a client-server environment, where PXE-enabled clients can boot their machines by using PXE boot images retrieved from a preconfigured PXE Boot Server.
Problem Statement
In this article, we will setup a Linux PXE server in RHEL 7, and add option to install Red Hat Enterprise Linux 7 therein.
Our PXE boot server requires different services such as DHCP, TFTP and FTP to function properly. Although, it is not necessary to configure all these services on a single machine, and if you have a running FTP server, you may place the required installation files on your existing FTP server. Similarly, if you have a DHCP server configured for your network, you may define the DHCP configurations therein.
However, for simplicity, we will configure all these services on the same machine.

System Specification
We have a Linux machine with following machine. We will setup it as the PXE boot server.
- CPU – 2 Core (2.4 Mhz)
- Memory – 2 GB
- Storage – 50 GB
- Operating System – RHEL 7.5
- Hostname – pxe-server.itlab.com
- IP Address – 192.168.116.41/24
Recommended Training: The Linux Command Line Bootcamp: Beginner To Power User from Colt Steele

Configure DHCP Service
Connect to pxe-server.itlab.com using ssh.
Install DHCP server using yum.
yum install -y dhcp
Configure DHCP service.
cat >> /etc/dhcp/dhcpd.conf << EOF
#DHCP configuration for PXE boot server
ddns-update-style interim;
ignore client-updates;
authoritative;
allow booting;
allow bootp;
allow unknown-clients;
subnet 192.168.116.0
netmask 255.255.255.0
{
range 192.168.116.100 192.168.116.199;
option domain-name-servers 192.168.116.2;
option domain-name "itlab.com";
option routers 192.168.116.2;
option broadcast-address 192.168.116.255;
default-lease-time 600;
max-lease-time 7200;
#PXE boot server
next-server 192.168.116.41;
filename "pxelinux.0";
}
EOF
Start and enable dhcpd.service.
systemctl start dhcpd.service
systemctl enable dhcpd.service
Allow DHCP service through Linux firewall. Also, proxy-dhcp port is required for propagation of TFTP server’s IP Address.
firewall-cmd --permanent --add-service={dhcp,proxy-dhcp}
firewall-cmd --reload
Acer Aspire 3 A315-24P-R7VH Slim Laptop | 15.6″ Full HD IPS Display | AMD Ryzen 3 7320U Quad-Core Processor | AMD Radeon Graphics | 8GB LPDDR5 | 128GB NVMe SSD | Wi-Fi 6 | Windows 11 Home in S Mode
14% OffConfigure TFTP Service
Install TFTP (Trivial FTP) server using yum.
yum install -y tftp-server
Start and enable tftp.service.
systemctl start tftp.service
systemctl enable tftp.service
Allow TFTP service through Linux firewall.
firewall-cmd --permanent --add-service=tftp
firewall-cmd --reload
Configure FTP Service
FTP Service is required to share the OS Installation media to PXE boot clients. Some system administrators use NFS instead of FTP service. However, if we use NFS then we have to configure Samba as well, when we are going to add Microsoft Windows OS installation options to our PXE boot server. Therefore, it is good to use a single common technology to share the OS installation media for different operating systems. HTTP is also a good alternative of FTP, and can be used to share OS installation media.
Install VSFTPD server using yum.
yum install -y vsftpd
Start and enable vsftpd.service.
systemctl enable vsftpd.service
systemctl start vsftpd.service
Allow FTP Service through Linux firewall.
firewall-cmd --permanent --add-service=ftp
firewall-cmd --reload
Ozeino 2.4GHz Wireless Gaming Headset for PC, Ps5, Ps4 – Lossless Audio USB & Type-C Ultra Stable Gaming Headphones with Flip Microphone, 40-Hr Battery Gamer Headset for Switch, Laptop, Mobile, Mac
40% OffInstalling Syslinux
Syslinux package provides various bootloaders including FAT filesystem to boot into Microsoft Windows environment.
Install syslinux package via yum.
yum install -y syslinux
Configure PXE Boot Server
Copy necessary bootloaders (provided by syslinux) to /var/lib/tftpboot directory.
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
cp /usr/share/syslinux/menu.c32 /var/lib/tftpboot/
cp /usr/share/syslinux/mboot.c32 /var/lib/tftpboot/
cp /usr/share/syslinux/chain.c32 /var/lib/tftpboot/
Create necessary directories.
mkdir /var/lib/tftpboot/pxelinux.cfg
mkdir -p /var/lib/tftpboot/networkboot/rhel7
mkdir /var/ftp/pub/rhel7
Copy contents of RHEL 7.5 ISO to /var/ftp/pub/rhel7. we have mounted RHEL 7.5 ISO at /mnt/iso, therefore, we are using following command for copying contents of ISO file.
cp -rf /mnt/iso/ /var/ftp/pub/rhel7
Copy boot images of RHEL 7.5 to /var/lib/tftpboot/networkboot/rhel7 directory.
cp /var/ftp/pub/rhel7/images/pxeboot/{initrd.img,vmlinuz} /var/lib/tftpboot/networkboot/rhel7/
Configure PXE boot menu and add Red Hat Enterprise Linux 7 installation option therein.
cat >> /var/lib/tftpboot/pxelinux.cfg/default << EOF
default menu.c32
prompt 0
timeout 30
menu title Ahmer's PXE Menu
label Install RHEL 7.5
kernel /networkboot/rhel7/vmlinuz
append initrd=/networkboot/rhel7/initrd.img inst.repo=ftp://192.168.116.41/pub/rhel7
EOF
Connect a new system to network and boot it. The new system will automatically obtain an IP Address from our DHCP Server and obtain the PXE boot menu from PXE Server and display it as follows:

Since, we have only one installation option so far, therefore, press <ENTER> to start installation.

We have successfully setup a PXE boot server in RHEL/CentOS 7. The installation process here is not automated. In our next article Kickstart: Automate PXE Client Installations, we will transform the same manual installation process to an automated installation with predefined configurations using Kickstart.
Frequently Asked Questions (FAQs)
What is a PXE server, and what is it used for?
A PXE (Preboot eXecution Environment) server allows computers to boot and install an operating system over a network, eliminating the need for physical media like USB drives or DVDs. It’s commonly used for deploying Linux systems across multiple machines.
What do I need to set up a PXE server?
You need a Linux machine as the server, a DHCP server to assign IP addresses, a TFTP server to transfer boot files, and an NFS/HTTP/FTP server to host the installation files. All these services can run on the same machine.
Do I need a separate DHCP server for PXE?
If your network already has a DHCP server, you’ll need to configure it to point to your PXE server. If not, you can set up a DHCP server on the same machine as your PXE server.
Can I use PXE to install different Linux distributions?
Yes, you can configure the PXE server to offer multiple Linux distributions by adding their respective boot files and installation sources to the server.
Is a PXE server secure?
PXE itself doesn’t include encryption, so it’s best used in a trusted local network. For security, restrict access via firewall rules and ensure only authorized clients can boot from the PXE server.
Linux Command Line and Shell Scripting Bible
41% OffFinal Thoughts
Setting up a Linux PXE server isn’t just a cool trick—it’s a game-changer for sysadmins and IT teams who value speed, scalability, and control. You’ve now seen how simple it can be to configure your network for unattended OS installations and deployments. Don’t wait until you’re knee-deep in repetitive setups or lagging behind competitors who’ve already streamlined their infrastructure.
Take action now: implement what you’ve learned and experience the freedom and power of PXE. The future of efficient Linux deployment is already here—will you be part of it, or play catch-up later?
Need expert AWS and Linux system administration? From cloud architecture to server optimization, I provide reliable and efficient solutions tailored to your needs. Hire me on Fiverr today!
Leave a Reply
You must be logged in to post a comment.