Operations 9 min read

Master Automated RHEL 8 Installation with Kickstart: Complete Guide & Sample File

This article explains how to create and use Kickstart answer files for fully automated RHEL 8 installations, covering each directive, package selection, and the steps to add the Kickstart path to both BIOS/Legacy and UEFI boot menus, complete with example code.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Master Automated RHEL 8 Installation with Kickstart: Complete Guide & Sample File

What is a Kickstart File?

A Kickstart file is an answer file that enables fully automated system installation.

Example Kickstart File

#version=RHEL8
ignoredisk --only-use=sda
autopart --type=lvm
# Partition clearing information
clearpart --all --initlabel --drives=sda
# Use graphical install
graphical
# Reboot after installation
reboot
repo --name="AppStream" --baseurl=ftp://10.10.10.53/dvd/AppStream
url --url="ftp://10.10.10.53/dvd"
keyboard --vckeymap=us --xlayouts='us'
firstboot --disable
lang en_US.UTF-8

# Network information
network  --bootproto=dhcp --device=ens192 --ipv6=auto --activate
network  --hostname=localhost.localdomain
# Root password
rootpw --iscrypted $6$VrOUsKRz8dywq5D5$1SbE62Vu/YPtzqd.4Y0U/M6fqILDluHAPFU5Kt9GkAS8eZVC7.yA/aBCzkWbNx0MJicFBR2MmipOItFBdqW6X.
# X Window System configuration
xconfig  --startxonboot
# System services
services --enabled="chronyd"
# System timezone
timezone Asia/Shanghai --isUtc
user --groups=wheel --name=it --password=$6$fI8GAHa5Q6JG1BB3$6/Dv5ndCa4KMIkVFBkmVzvnV.SvwSO5.h0ppaaI75f53G9dH4.l6yUR.IUYGTKX/ctKwyzliKJQtOpV7TAZqI. --iscrypted --gecos="it"

%packages
@^graphical-server-environment
kexec-tools
%end

%addon com_redhat_kdump --enable --reserve-mb='auto'
%end

%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end

Kickstart Directives Explained

ignoredisk : Controls which disks are ignored during installation. Use --only-use=sda to install only on sda.

autopart : Automatically creates root, swap, and appropriate boot partitions; can specify type (e.g., --type=lvm) and filesystem ( --fstype=xfs, ext4, etc.).

clearpart : Clears existing partitions; --all removes all partitions on specified drives.

graphical / text: Choose graphical or text‑mode installation.

reboot : Reboots after installation completes.

repo and url : Define additional package repositories and network installation source.

keyboard : Set keyboard layout with --vckeymap=us and --xlayouts='us'.

firstboot : Enable or disable the Initial Setup wizard on first boot ( --disable disables it).

lang : Set system language.

network : Configure networking; --bootproto=dhcp or static, device name, activation, hostname, IP, netmask, gateway, DNS, IPv6, etc.

rootpw : Define the root password; --iscrypted indicates a hashed password.

xconfig : Configure X Window System; --startxonboot enables graphical login.

services : Enable or disable services with --enabled or --disabled.

timezone : Set the system timezone.

user : Add additional users, specifying name, groups, password (hashed with --iscrypted), and GECOS information.

%packages : List packages to install. Use @ for package groups, @^ for environment groups, or list individual packages. Prefix a package with - to exclude it.

%addon : Configure add‑ons such as kdump; --enable and --reserve-mb='auto' reserve memory.

%anaconda : Set password policies; ends with %end.

%pre and %post : Run scripts before partitioning and after installation, respectively; both must end with %end.

Adding the Kickstart Path to the Boot Menu

Save the Kickstart file as ks.cfg on an FTP server (e.g., ftp://10.10.10.53/ks.cfg).

BIOS/Legacy Boot

[it@pxesvr ~]$ sudo vim /tftpboot/pxelinux.cfg/default
[label linux]
  menu label ^Install Red Hat Enterprise Linux 8.0
  kernel vmlinuz
  append initrd=initrd.img inst.stage2=ftp://10.10.10.53/dvd inst.ks=ftp://10.10.10.53/ks.cfg quiet

UEFI Boot

[it@pxesvr ~]$ sudo vim /tftpboot/uefi/grub.cfg
menuentry 'Install Red Hat Enterprise Linux 8.0' --class fedora --class gnu-linux --class gnu --class os {
  linuxefi vmlinuz inst.stage2=ftp://10.10.10.53/dvd inst.ks=ftp://10.10.10.53/ks.cfg quiet
  initrdefi initrd.img
}

After configuring the PXE server, you can perform fully automated RHEL 8 installations.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxPXEKickstartRHELAutomated Installation
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.