Chapter 5. Preparing network-based repositories
You must prepare repositories to install RHEL from your network system.
5.1. Creating an installation source on an NFS server Copy linkLink copied to clipboard!
You can configure an NFS server to host RHEL installation files for network-based installations. It enables multiple systems to install from a shared network location, providing efficient deployment across your infrastructure without requiring physical media for each system.
Prerequisites
- You have administrator-level access to a server with Red Hat Enterprise Linux 10, and this server is on the same network as the system to be installed.
- You have downloaded the full installation DVD ISO from the Product Downloads page.
Ensure that you use different paths in inst.ks and inst.repo. When using NFS to host the installation source, you cannot use the same nfs share to host the Kickstart.
Procedure
Install the
nfs-utilspackage:dnf install nfs-utils
# dnf install nfs-utilsCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Copy the DVD ISO image to a directory on the NFS server. This example assumes the DVD ISO is copied to the
/nfs/rhel10-install/directory on the NFS server. Open the
/etc/exportsfile using a text editor and add a line with the following syntax:/exported_directory/ clients
/exported_directory/ clientsCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Replace /exported_directory/ with the full path to the directory with the ISO image.
Replace clients with one of the following:
- The host name or IP address of the target system
- The subnetwork that all target systems can use to access the ISO image
-
To allow any system with network access to the NFS server to use the ISO image, the asterisk sign (
*)
See the
exports(5)man page for detailed information about the format of this field.For example, a basic configuration that makes the
/nfs/rhel10-install/directory available as read-only to all clients is:/nfs/rhel10-install *
/nfs/rhel10-install *Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Save the
/etc/exportsfile and exit the text editor. Enable the NFS service in firewalld:
firewall-cmd --permanent --add-service nfs firewall-cmd --permanent --add-service=mountd firewall-cmd --permanent --add-service=rpc-bind firewall-cmd --reload
# firewall-cmd --permanent --add-service nfs # firewall-cmd --permanent --add-service=mountd # firewall-cmd --permanent --add-service=rpc-bind # firewall-cmd --reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start the nfs service:
systemctl enable --now nfs-server.service
# systemctl enable --now nfs-server.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow If the service was running before you changed the
/etc/exportsfile, reload the NFS server configuration:systemctl reload nfs-server.service
# systemctl reload nfs-server.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow The ISO image is now accessible over NFS and ready to be used as an installation source.
When configuring the installation source, use
nfs:as the protocol, the server host name or IP address, the colon sign(:), and the directory holding the ISO image. For example, if the server host name ismyserver.example.comand you have saved the ISO image in/nfs/rhel10-install/, specifynfs:myserver.example.com:/rhel-10-install/as the installation source.
5.2. Creating an installation source by using HTTP or HTTPS Copy linkLink copied to clipboard!
You can create an installation source for a network-based installation by using an installation tree. It is a directory containing extracted contents of the DVD ISO image and a valid .treeinfo file. The installation source is accessed over HTTP or HTTPS.
Prerequisites
- You have administrator-level access to a server with Red Hat Enterprise Linux 10, and this server is on the same network as the system to be installed.
- You have downloaded the full installation DVD ISO from the Product Downloads page.
If you use an HTTPS server with a self-signed certificate, you must boot the installation program with the noverifyssl option.
Procedure
Install the httpd package.
dnf install httpd
# dnf install httpdCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Install the
mod_sslpackage if you want to use the https installation source:dnf install mod_ssl
# dnf install mod_sslCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy the DVD ISO image to the HTTP(S) server.
Create a suitable directory for mounting the DVD ISO image, for example:
mkdir /mnt/rhel10-install/
# mkdir /mnt/rhel10-install/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Mount the DVD ISO image to the directory:
mount -o loop,ro -t iso9660 /image_directory/image.iso /mnt/rhel10-install/
# mount -o loop,ro -t iso9660 /image_directory/image.iso /mnt/rhel10-install/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace /image_directory/image.iso with the path to the DVD ISO image.
Copy the files from the mounted image to the HTTP(S) server root.
cp -r /mnt/rhel10-install/ /var/www/html/
# cp -r /mnt/rhel10-install/ /var/www/html/Copy to Clipboard Copied! Toggle word wrap Toggle overflow This command creates the
/var/www/html/rhel10-install/directory with the content of the image. Note that some other copying methods might skip the.treeinfofile which is required for a valid installation source. Entering thecpcommand for entire directories copies.treeinfocorrectly.Unmount the DVD ISO:
umount /mnt/rhel10-install/
# umount /mnt/rhel10-install/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the http service in firewalld:
firewall-cmd --permanent --add-service=http firewall-cmd --reload
# firewall-cmd --permanent --add-service=http # firewall-cmd --reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Enable the https service in firewalld:
firewall-cmd --permanent --add-service=https firewall-cmd --reload
# firewall-cmd --permanent --add-service=https # firewall-cmd --reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start the
httpdservice:systemctl enable --now httpd.service
# systemctl enable --now httpd.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow The installation tree is now accessible and ready to be used as the installation source.
NoteWhen configuring the installation source, use
http://orhttps://as the protocol, the server host name or IP address, and the directory that contains the files from the ISO image, relative to the HTTP server root. For example, if you use HTTP, the server host name ismyserver.example.com, and you have copied the files from the image to/var/www/html/rhel10-install/, specifyhttp://myserver.example.com/rhel10-install/as the installation source.
5.3. Creating an installation source by using FTP Copy linkLink copied to clipboard!
You can set up an FTP server to host RHEL installation files for network-based installations. It enables multiple systems to install from a centralized source, providing efficient deployment across your network infrastructure using the FTP protocol.
Prerequisites
- You have administrator-level access to a server with Red Hat Enterprise Linux 10, and this server is on the same network as the system to be installed.
- You have downloaded the full installation DVD ISO from the Product Downloads page.
-
The
vsftpdpackage is installed.
Procedure
Install the vsftpd package.
dnf install vsftpd
# dnf install vsftpdCopy to Clipboard Copied! Toggle word wrap Toggle overflow Open and edit the
/etc/vsftpd/vsftpd.confconfiguration file in a text editor.-
Change the line
anonymous_enable=NOtoanonymous_enable=YES -
Change the line
write_enable=YEStowrite_enable=NO. Add lines
pasv_min_port=<min_port>andpasv_max_port=<max_port>. Replace <min_port> and <max_port> with the port number range used by the FTP server in passive mode, for example,10000and11000.This step might be necessary in network environments featuring various firewall/NAT setups.
- Optional: Add custom changes to your configuration. For available options, see the vsftpd.conf(5) man page. This procedure assumes that default options are used.
Configure the firewall to allow the FTP port and port range from the previous step:
firewall-cmd --add-port min_port-max_port/tcp --permanent
# firewall-cmd --add-port min_port-max_port/tcp --permanentCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace <min_port> and <max_port> with the port numbers you entered into the
/etc/vsftpd/vsftpd.confconfiguration file.Configure the firewall to allow FTP service
firewall-cmd --add-service ftp --permanent
# firewall-cmd --add-service ftp --permanentCopy to Clipboard Copied! Toggle word wrap Toggle overflow Reload the firewall to apply the new rules:
firewall-cmd --reload
# firewall-cmd --reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Change the line
- Copy the DVD ISO image to the FTP server.
Create a suitable directory for mounting the DVD ISO image, for example:
mkdir /mnt/rhel10-install
# mkdir /mnt/rhel10-installCopy to Clipboard Copied! Toggle word wrap Toggle overflow Mount the DVD ISO image to the directory:
mount -o loop,ro -t iso9660 /image-directory/image.iso /mnt/rhel10-install
# mount -o loop,ro -t iso9660 /image-directory/image.iso /mnt/rhel10-installCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
/image-directory/image.isowith the path to the DVD ISO image.Copy the files from the mounted image to the FTP server root:
cp -r /mnt/rhel10-install/ /var/ftp/
# cp -r /mnt/rhel10-install/ /var/ftp/Copy to Clipboard Copied! Toggle word wrap Toggle overflow This command creates the
/var/ftp/rhel10-install/directory with the content of the image. Some copying methods can skip the.treeinfofile which is required for a valid installation source. Entering thecpcommand for whole directories as shown in this procedure will copy.treeinfocorrectly.Start the
vsftpdservice:systemctl enable --now vsftpd.service
# systemctl enable --now vsftpd.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow If the service was running before you changed the
/etc/vsftpd/vsftpd.conffile, restart the service to load the edited file:systemctl restart vsftpd.service
# systemctl restart vsftpd.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow The installation tree is now accessible and ready to be used as the installation source.
When configuring the installation source, use
ftp://as the protocol, the server host name or IP address, and the directory in which you have stored the files from the ISO image, relative to the FTP server root. For example, if the server host name ismyserver.example.comand you have copied the files from the image to/var/ftp/rhel10-install/, specifyftp://myserver.example.com/rhel10-install/as the installation source.