Preparing for your installation

If you are new to CentOS, it is important to prepare for your installation by reviewing system requirements, downloading the required installation image, and creating installation media.

Recommended steps

Preparing for your installation consists of several steps.

  • If you are new to CentOS, complete steps 1 to 5.

  • If you are familiar with CentOS, complete steps 3 to 5.

Procedure
  1. Check system requirements.

  2. Choose an installation boot method.

  3. Select and download the installation image.

  4. Create bootable installation media.

  5. Prepare the installation source*

*Only required for the Boot ISO (minimal install) image.

Check system requirements

If this is a first-time installation of CentOS it is recommended that you review the guidelines provided for system, hardware, security, memory, and RAID before installing. See System requirements reference for more information.

Additional resources

For more information about securing CentOS, see the Security hardening in RHEL 8 document.

Choose an installation boot method

There are several methods to boot the CentOS installation program. The method you choose depends on your installation media.

Full installation DVD or USB flash drive

Create a full installation DVD or USB flash drive using the DVD1 ISO image. The DVD or USB flash drive can be used as a boot device and as an installation source for installing software packages. Due to the size of the DVD1 ISO image, a DVD or USB flash drive are the recommended media types.

Minimal installation DVD, CD, or USB flash drive

Create a minimal installation CD, DVD, or USB flash drive using the Boot ISO image, which contains only the minimum files necessary to boot the system and start the installation program. The Boot ISO image requires an installation source that contains the required software packages.

PXE Server

A preboot execution environment (PXE) server allows the installation program to boot over the network. After a system boot, you must complete the installation from a different installation source, such as a local hard drive or a network location.

Additional Resources

Select the required installation image

Two CentOS 8 installation images are available from the Downloads page.

DVD1 ISO image file

A full installation program that contains the BaseOS and AppStream repositories and allows you to complete the installation without additional repositories. Installing CentOS from the DVD1 ISO is the easiest and the recommended method of performing a standard CentOS 8 installation.

  • It is recommended that you use the DVD1 ISO image file to install CentOS 8.

Boot ISO image file

The Boot ISO image is a minimal installation that requires access to the BaseOS and AppStream repositories to install software packages. The repositories are part of the DVD1 ISO image that is available for download from https://wiki.centos.org/Download. Download and unpack the DVD1 ISO image to access the repositories.

The following table contains information about the images that are available for the supported architectures.

Table 1. Boot and Installation Images
Architecture Installation DVD Boot DVD

AMD64 and Intel 64

x86_64 DVD1 ISO image file

x86_64 Boot ISO image file

ARM 64

AArch64 DVD1 ISO image file

AArch64 Boot ISO image file

IBM POWER

ppc64le DVD1 ISO image file

ppc64le Boot ISO image file

Additional Resources

Downloading the installation ISO image

Before you start installing CentOS 8, you must download an installation ISO image. Images are available from the CentOS website at https://www.centos.org/download/. The following basic types of media are available:

DVD1 ISO

This image contains the installer as well as a set of all packages that can be installed during an interactive installation. Also sometimes referred to as the "Binary DVD" or "Binary ISO image". This is the recommended download for most users.

Boot ISO

Contains only the installer, but not any installable packages. This image will allow you to start the installation, but you must prepare a package source and enter its URL in the Package Selection screen, using a boot option, or using a Kickstart command in order to finish the installation.

Optionally, you can use a checksum utility such as sha256sum to verify the integrity of the image file after the download finishes. All downloads are provided with their checksums for reference:

$ sha256sum CentOS-8-x86_64-dvd.iso
85a...46c  CentOS-8-x86_64-dvd.iso

Similar tools are available for Microsoft Windows and Mac OS X. You can also use the rd.live.check option on the boot command line; see Editing boot options for details.

After you have downloaded an ISO image file from the Customer Portal, you can:

Creating installation media

This section contains information about using the ISO image file that you downloaded in Downloading the installation ISO image to create bootable physical installation media, such as a USB, DVD, or CD.

For instructions on how to set up a Preboot Execution Environment (PXE) server to perform a PXE-based installation over a network, see Preparing to install from the network using PXE.

By default, the inst.stage2= boot option is used on the installation media and is set to a specific label, for example, inst.stage2=hd:LABEL=CentOS8\x86_64. If you modify the default label of the file system containing the runtime image, or if you use a customized procedure to boot the installation system, you must verify that the label is set to the correct value.

Creating a bootable DVD or CD

You can create a bootable installation DVD or CD using burning software and a CD/DVD burner. The exact steps to produce a DVD or CD from an ISO image file vary greatly, depending on the operating system and disc burning software installed. Consult your system’s burning software documentation for the exact steps to burn a CD or DVD from an ISO image file.

You can create a bootable DVD or CD using either the DVD1 ISO image (contains installer and packages), or the Boot ISO image (only contains the installer, requires an additional package source). However, the DVD1 ISO image is larger than 4.7 GB, and as a result, it might not fit on a single-layer DVD. A dual-layer DVD or USB key is recommended when using the DVD1 ISO image to create bootable installation media.

Creating a bootable USB device on Linux

Follow this procedure to create a bootable USB device on a Linux system.

Prerequisites

  • You have downloaded an installation ISO image as described in Downloading the installation ISO image.

  • The DVD1 ISO image is larger than 4.7 GB, so you must have a USB flash drive that is large enough to hold the ISO image.

Procedure

This procedure is destructive and data on the USB flash drive is destroyed without a warning.

  1. Connect the USB flash drive to the system.

  2. Open a terminal window and run the dmesg command:

    $ dmesg|tail

    The dmesg command returns a log that details all recent events. Messages resulting from the attached USB flash drive are displayed at the bottom of the log. Record the name of the connected device.

  3. Switch to user root:

    $ su -
  4. Enter your root password when prompted.

  5. Find the device node assigned to the drive. In this example, the drive name is sdd.

    # dmesg|tail
    [288954.686557] usb 2-1.8: New USB device strings: Mfr=0, Product=1, SerialNumber=2
    [288954.686559] usb 2-1.8: Product: USB Storage
    [288954.686562] usb 2-1.8: SerialNumber: 000000009225
    [288954.712590] usb-storage 2-1.8:1.0: USB Mass Storage device detected
    [288954.712687] scsi host6: usb-storage 2-1.8:1.0
    [288954.712809] usbcore: registered new interface driver usb-storage
    [288954.716682] usbcore: registered new interface driver uas
    [288955.717140] scsi 6:0:0:0: Direct-Access     Generic  STORAGE DEVICE   9228 PQ: 0 ANSI: 0
    [288955.717745] sd 6:0:0:0: Attached scsi generic sg4 type 0
    [288961.876382] sd 6:0:0:0: sdd Attached SCSI removable disk
  6. Run the dd command to write the ISO image directly to the USB device.

    # dd if=/image_directory/image.iso of=/dev/device

    Replace /image_directory/image.iso with the full path to the ISO image file that you downloaded, and replace device with the device name that you retrieved with the dmesg command. In this example, the full path to the ISO image is /home/testuser/Downloads/CentOS-8-x86_64-boot.iso, and the device name is sdd:

    # dd if=/home/testuser/Downloads/CentOS-8-x86_64-boot.iso of=/dev/sdd

    Ensure that you use the correct device name, and not the name of a partition on the device. Partition names are usually device names with a numerical suffix. For example, sdd is a device name, and sdd1 is the name of a partition on the device sdd.

  7. Wait for the dd command to finish writing the image to the device. The data transfer is complete when the # prompt appears. When the prompt is displayed, log out of the root account and unplug the USB drive. The USB drive is now ready to be used as a boot device.

Creating a bootable USB device on Windows

Follow the steps in this procedure to create a bootable USB device on a Windows system. The procedure varies depending on the tool. CentOS Project recommends using Fedora Media Writer, available for download at https://github.com/FedoraQt/MediaWriter/releases.

Fedora Media Writer is a Fedora community product and is not supported by CentOS Project. You can report any issues with the tool at https://github.com/FedoraQt/MediaWriter/issues.

Prerequisites

  • You have downloaded an installation ISO image as described in Downloading the installation ISO image.

  • The DVD1 ISO image is larger than 4.7 GB, so you must have a USB flash drive that is large enough to hold the ISO image.

Procedure

This procedure is destructive and data on the USB flash drive is destroyed without a warning.

  1. Download and install Fedora Media Writer from https://github.com/FedoraQt/MediaWriter/releases.

    To install Fedora Media Writer on CentOS, use the pre-built Flatpak package. You can obtain the package from the official Flatpak repository Flathub.org at https://flathub.org/apps/details/org.fedoraproject.MediaWriter.

  2. Connect the USB flash drive to the system.

  3. Open Fedora Media Writer.

  4. From the main window, click Custom Image and select the previously downloaded CentOS ISO image.

  5. From Write Custom Image window, select the drive that you want to use.

  6. Click Write to disk. The boot media creation process starts. Do not unplug the drive until the operation completes. The operation may take several minutes, depending on the size of the ISO image, and the write speed of the USB drive.

  7. When the operation completes, unmount the USB drive. The USB drive is now ready to be used as a boot device.

Creating a bootable USB device on Mac OS X

Follow the steps in this procedure to create a bootable USB device on a Mac OS X system.

Prerequisites

  • You have downloaded an installation ISO image as described in Downloading the installation ISO image.

  • The DVD1 ISO image is larger than 4.7 GB, so you must have a USB flash drive that is large enough to hold the ISO image.

Procedure

This procedure is destructive and data on the USB flash drive is destroyed without a warning.

  1. Connect the USB flash drive to the system.

  2. Identify the device path with the diskutil list command. The device path has the format of /dev/disknumber, where number is the number of the disk. The disks are numbered starting at zero (0). Typically, Disk 0 is the OS X recovery disk, and Disk 1 is the main OS X installation. In the following example, the USB device is disk2:

    $ diskutil list
    /dev/disk0
    #:                       TYPE NAME                    SIZE       IDENTIFIER
    0:      GUID_partition_scheme                        *500.3 GB   disk0
    1:                        EFI EFI                     209.7 MB   disk0s1
    2:          Apple_CoreStorage                         400.0 GB   disk0s2
    3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
    4:          Apple_CoreStorage                         98.8 GB    disk0s4
    5:                 Apple_Boot Recovery HD             650.0 MB   disk0s5
    /dev/disk1
    #:                       TYPE NAME                    SIZE       IDENTIFIER
    0:                  Apple_HFS YosemiteHD             *399.6 GB   disk1
    Logical Volume on disk0s1
    8A142795-8036-48DF-9FC5-84506DFBB7B2
    Unlocked Encrypted
    /dev/disk2
    #:                       TYPE NAME                    SIZE       IDENTIFIER
    0:     FDisk_partition_scheme                        *8.0 GB     disk2
    1:               Windows_NTFS SanDisk USB             8.0 GB     disk2s1
  3. To identify your USB flash drive, compare the NAME, TYPE and SIZE columns to your flash drive. For example, the NAME should be the title of the flash drive icon in the Finder tool. You can also compare these values to those in the information panel of the flash drive.

  4. Use the diskutil unmountDisk command to unmount the flash drive’s filesystem volumes:

    $ diskutil unmountDisk /dev/disknumber
    Unmount of all volumes on disknumber was successful

    When the command completes, the icon for the flash drive disappears from your desktop. If the icon does not disappear, you may have selected the wrong disk. Attempting to unmount the system disk accidentally returns a failed to unmount error.

  5. Log in as root:

    $ su -
  6. Enter your root password when prompted.

  7. Use the dd command as a parameter of the sudo command to write the ISO image to the flash drive:

    # sudo dd if=/path/to/image.iso of=/dev/rdisknumber bs=1m>

    Mac OS X provides both a block (/dev/disk*) and character device (/dev/rdisk*) file for each storage device. Writing an image to the /dev/rdisknumber character device is faster than writing to the /dev/disknumber block device.

  8. To write the /Users/user_name/Downloads/CentOS-8-x86_64-boot.iso file to the /dev/rdisk2 device, run the following command:

    # sudo dd if=/Users/user_name/Downloads/CentOS-8-x86_64-boot.iso of=/dev/rdisk2
  9. Wait for the dd command to finish writing the image to the device. The data transfer is complete when the # prompt appears. When the prompt is displayed, log out of the root account and unplug the USB drive. The USB drive is now ready to be used as a boot device.

Preparing an installation source

The Boot ISO image file does not include any repositories or software packages; it contains only the installation program and the tools required to boot the system and start the installation. This section contains information about creating an installation source for the Boot ISO image using the DVD1 ISO image that contains the required repositories and software packages.

Creating an installation source is required only for the Boot ISO image. CentOS Project recommends the DVD1 ISO image as the preferred method to install CentOS.

Types of installation source

You can use one of the following installation sources for minimal boot images:

  • DVD: Burn the DVD1 ISO image to a DVD. The installation program will automatically install the software packages from the DVD.

  • Hard drive or USB drive: Copy the DVD1 ISO image to the drive and configure the installation program to install the software packages from the drive. If you use a USB drive, verify that it is connected to the system before the installation begins. The installation program cannot detect media after the installation begins.

    • Hard drive limitation: The DVD1 ISO image on the hard drive must be on a partition with a file system that the installation program can mount. The supported file systems are xfs, ext2, ext3, ext4, and vfat (FAT32).

    On Microsoft Windows systems, the default file system used when formatting hard drives is NTFS. The exFAT file system is also available. However, neither of these file systems can be mounted during the installation. If you are creating a hard drive or a USB drive as an installation source on Microsoft Windows, verify that you formatted the drive as FAT32. Note that the FAT32 file system cannot store files larger than 4 GiB.

    In CentOS 8, you can enable installation from a directory on a local hard drive. To do so, you need to copy the contents of the DVD ISO image to a directory on a hard drive and then specify the directory as the installation source instead of the ISO image. For example: inst.repo=hd:<device>:<path to the directory>

  • Network location: Copy the DVD1 ISO image or the installation tree (extracted contents of the DVD1 ISO image) to a network location and perform the installation over the network using the following protocols:

    • NFS: The DVD1 ISO image is in a Network File System (NFS) share.

    • HTTPS, HTTP or FTP: The installation tree is on a network location that is accessible over HTTP, HTTPS or FTP.

Specify the installation source

You can specify the installation source using any of the following methods:

  • Graphical installation: Select the installation source in the Installation Source window of the graphical installation. See Configuring installation source for more information.

  • Boot option: Configure a custom boot option to specify the installation source. See Boot options reference for more information.

  • Kickstart file: Use the install command in a Kickstart file to specify the installation source. See the Performing an advanced installation document for more information.

Ports for network-based installation

The following table lists the ports that must be open on the server providing the files for each type of network-based installation.

Table 2. Ports for network-based installation
Protocol used Ports to open

HTTP

80

HTTPS

443

FTP

21

NFS

2049, 111, 20048

TFTP

69

Additional resources

Creating an installation source on an NFS server

Follow the steps in this procedure to place the installation source on an NFS server. Use this installation method to install multiple systems from a single source, without having to connect to physical media.

Prerequisites

  • You have administor level access to a server with CentOS 8, and this server is on the same network as the system to be installed.

  • You have downloaded a DVD1 ISO image. See Downloading the installation ISO image for more information.

  • You have created a bootable CD, DVD, or USB device from the image file. See Creating installation media for more information.

  • You have verified that your firewall allows the system you are installing to access the remote installation source. See Ports for network-based installation for more information.

Procedure

  1. Install the nfs-utils package:

    # yum install nfs-utils
  2. Copy the DVD1 ISO image to a directory on the NFS server.

  3. Open the /etc/exports file using a text editor and add a line with the following syntax:

    /exported_directory/ clients
  4. Replace /exported_directory/ with the full path to the directory with the ISO image. Replace clients with the host name or IP address of the target system, the subnetwork that all target systems can use to access the ISO image, or the asterisk sign (*) if you want to allow any system with network access to the NFS server to use the ISO image. See the exports(5) man page for detailed information about the format of this field.

    A basic configuration that makes the /centos8-install/ directory available as read-only to all clients is:

    /centos8-install *
  5. Save the /etc/exports file and exit the text editor.

  6. Start the nfs service:

    # systemctl start nfs-server.service

    If the service was running before you changed the /etc/exports file, run the following command for the running NFS server to reload its configuration:

    # systemctl reload nfs-server.service

    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 is myserver.example.com and you have saved the ISO image in /centos8-install/, specify nfs:myserver.example.com:/centos8-install/ as the installation source.

Creating an installation source using HTTP or HTTPS

Follow the steps in this procedure to create an installation source for a network-based installation using an installation tree, which is a directory containing extracted contents of the DVD1 ISO image and a valid .treeinfo file. The installation source is accessed over HTTP or HTTPS.

Prerequisites

  • You have administor level access to a server with CentOS 8, and this server is on the same network as the system to be installed.

  • You have downloaded a DVD1 ISO image. See Downloading the installation ISO image for more information.

  • You have created a bootable CD, DVD, or USB device from the image file. See Creating installation media for more information.

  • You have verified that your firewall allows the system you are installing to access the remote installation source. See Ports for network-based installation for more information.

Procedure

  1. Install the httpd package:

    # yum install httpd

    If your Apache web server configuration enables SSL security, verify that you enable only the TLSv1 protocol, and disable SSLv2 and SSLv3. This is due to the POODLE SSL vulnerability (CVE-2014-3566). See https://access.redhat.com/solutions/1232413 for details.

    If you use an HTTPS server with a self-signed certificate, you must boot the installation program with the noverifyssl option.

  2. Copy the DVD1 ISO image to the HTTP(S) server.

  3. Mount the DVD1 ISO image, using the mount command, to a suitable directory:

    # mkdir /mnt/centos8-install/
    # mount -o loop,ro -t iso9660 /image_directory/image.iso /mnt/centos8-install/

    Replace /image_directory/image.iso with the path to the DVD1 ISO image.

  4. Copy the files from the mounted image to the HTTP(S) server root. This command creates the /var/www/html/centos8-install/ directory with the contents of the image.

    # cp -r /mnt/centos8-install/ /var/www/html/

    This command creates the /var/www/html/centos8-install/ directory with the content of the image. Note that some copying methods can skip the .treeinfo file which is required for a valid installation source. Running the cp command for whole directories as shown in this procedure will copy .treeinfo correctly.

  5. Start the httpd service:

    # systemctl start httpd.service

    The installation tree is now accessible and ready to be used as the installation source.

    When configuring the installation source, use http:// or https:// 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 are using HTTP, the server host name is myserver.example.com, and you have copied the files from the image to /var/www/html/centos8-install/, specify http://myserver.example.com/centos8-install/ as the installation source.

Additional resources

Creating an installation source using FTP

Follow the steps in this procedure to create an installation source for a network-based installation using an installation tree, which is a directory containing extracted contents of the DVD1 ISO image and a valid .treeinfo file. The installation source is accessed over FTP.

Prerequisites

  • You have administor level access to a server with CentOS 8, and this server is on the same network as the system to be installed.

  • You have downloaded a DVD1 ISO image. See Downloading the installation ISO image for more information.

  • You have created a bootable CD, DVD, or USB device from the image file. See Creating installation media for more information.

  • You have verified that your firewall allows the system you are installing to access the remote installation source. See Ports for network-based installation for more information.

Procedure

  1. Install the vsftpd package by running the following command as root:

    # yum install vsftpd
  2. Open and edit the /etc/vsftpd/vsftpd.conf configuration file in a text editor.

    1. Change the line anonymous_enable=NO to anonymous_enable=YES

    2. Change the line write_enable=YES to write_enable=NO.

    3. Add lines pasv_min_port=min_port and pasv_max_port=max_port. Replace min_port and max_port with the port number range used by FTP server in passive mode, e. g. 10021 and 10031.

      This step can be necessary in network environments featuring various firewall/NAT setups.

    4. Optionally, add custom changes to your configuration. For available options, see the vsftpd.conf(5) man page. This procedure assumes that default options are used.

      If you configured SSL/TLS security in your vsftpd.conf file, ensure that you enable only the TLSv1 protocol, and disable SSLv2 and SSLv3. This is due to the POODLE SSL vulnerability (CVE-2014-3566). See https://access.redhat.com/solutions/1234773 for details.

  3. Configure the server firewall.

    1. Enable the firewall:

      # systemctl enable firewalld
      # systemctl start firewalld
    2. Enable in your firewall the FTP port and port range from previous step:

      # firewall-cmd --add-port min_port-max_port/tcp --permanent
      # firewall-cmd --add-service ftp --permanent
      # firewall-cmd --reload

      Replace min_port-max_port with the port numbers you entered into the /etc/vsftpd/vsftpd.conf configuration file.

  4. Copy the DVD1 ISO image to the FTP server.

  5. Mount the DVD1 ISO image, using the mount command, to a suitable directory:

    # mkdir /mnt/centos8-install
    # mount -o loop,ro -t iso9660 /image-directory/image.iso /mnt/centos8-install

    Replace /image-directory/image.iso with the path to the DVD1 ISO image.

  6. Copy the files from the mounted image to the FTP server root:

    # mkdir /var/ftp/centos8-install
    # cp -r /mnt/centos8-install/ /var/ftp/

    This command creates the /var/ftp/centos8-install/ directory with the content of the image. Note that some copying methods can skip the .treeinfo file which is required for a valid installation source. Running the cp command for whole directories as shown in this procedure will copy .treeinfo correctly.

  7. Make sure that the correct SELinux context and access mode is set on the copied content:

    # restorecon -r /var/ftp/centos8-install
    # find /var/ftp/centos8-install -type f -exec chmod 444 {} \;
    # find /var/ftp/centos8-install -type d -exec chmod 755 {} \;
  8. Start the vsftpd service:

    # systemctl start vsftpd.service

    If the service was running before you changed the /etc/vsftpd/vsftpd.conf file, restart the service to load the edited file:

    # systemctl restart vsftpd.service

    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 is myserver.example.com and you have copied the files from the image to /var/ftp/centos8-install/, specify ftp://myserver.example.com/centos8-install/ as the installation source.