How To Install CentOS 7.6 Minimal Linux Server

CentOS or Community ENTerprise Operating System is a stable Linux distribution forked out of Red Hat Enterprise Linux (RHEL). It is a community-driven, available for free Linux server operating system. The active user community includes the core developers, network managers, and Linux contributors.

In this tutorial, we are going to learn how to install CentOS 7.6 minimal edition on a physical or a virtual server using a downloaded ISO image.

Step 1: Preparation

There are several options available to download CentOS.

DVD ISO Image

This is the full edition of CentOS with a download size of 4.3 GB. This installs bare metal CentOS additionally few other packages may or may not need for a fully functional server OS. No Internet connection is required for this image during installation.

Minimal ISO Image

At a size of 918 MB, this image comes with bare essential packages to install a fully functional CentOS server. All other packages must be install as needed basis. This image also does not require an Internet connection during installation. We recommend this image as it keeps the OS as lean and secure as possible.

Network Install Image

As the name suggests this is a CD image with essential packages needed to get the installation started. The rest is done by downloading the required packages as the installation progresses. Without an Internet connection, this image can be used to install CentOS.

Cloud-Init Enabled Image

This image leverages the use of cloud-init to automate the installation process so all systems are installed exactly the same way. Cloud-init uses YAML based file to pre-configure a system. This is a much better solution than old-school BOOTP/PXE.

Step 2: Download and Verify Image

CentOS distribution image can be downloaded from any of the mirrors freely available. Goto official CentOS Download page to select a mirror closer to you then download an installation image. For the purpose of this tutorial, we are going to download CentOS Minimal ISO image.

Verifying ISO Checksum

It is always a good idea to verify the checksum of the downloaded image. Even if the download is successful, files can still be corrupted during download or can be manipulated by someone on the mirror. Following 2 checksum files are provided by CentOS which are stored on the same ISO directory on the mirror:

sha256sum.txt
sha256sum.txt.asc

Download both files and store them locally on the same folder where the downloaded CentOS ISO image is stored.

Verify Checksum on Linux

If the ISO and the checksum files are downloaded on a Linux operating system, it is as easy as entering a command to check the image integrity.

$ sha256sum {iso_file}

So for our downloaded CentOS minimal ISO image, the command should appear as follows:

$ [email protected]> sha256sum CentOS-7-x86_64-Minimal-1810.iso
38d5d51d9d100fd73df031ffd6bd8b1297ce24660dc8c13a3b8b4534a4bd291c CentOS-7-x86_64-Minimal-1810.iso

how to install centos 7 1810 minimal checksum

As we can see the value matches for our downloaded minimal image so we can rest assure that the image file is error free and proceed with burning the image on to a disk or USB drive.

Verify on Microsoft Windows

To verify the checksum of the download ISO image, we need to download the sha256sum.exe tool and put it in the same folder as the image itself and the checksum files. Much like the tool on Linux, this also will compute and display the checksum hash to verify the integrity of the downloaded file.

Goto command prompt and into the download folder then run the tool as follows:

C:\> cd “C:\Documents and Settings\User\Downloads”
sha256sum.exe CentOS-7-x86_64-Minimal-1810.iso

The tool may take some time to calculate the checksum for the entire file and display the value. Match the result with the value shown in the checksum to ensure they both match. If they do not match, download the image again from a different mirror.

Step 3: Prepare Disk or USB Drive

After the integrity of the ISO image is verified we can proceed to copy the ISO image on to a DVD or USB drive is preferable. Issue the following command to copy the ISO directly onto a USB drive:

$ dd if=CentOS-7-x86_64-Minimal-1810.iso of=/dev/{usb_drive}

Replace {usb_drive} with the proper name of the USB device. This will replace all existing files on the USB drive. Ensure that existing files have been transferred elsewhere for safe keep prior to issuing this command.

For Windows user, use the tool Win32DiskImager to create a bootable USB drive with CentOS ISO image.

Step 4: Start Installation

Power up the physical or virtual server with ISO image loaded into an optical or USB drive. The server will boot into the startup screen of the installation process with few options such as start the actual install, test the installation media and troubleshooting. The troubleshooting menu is helpful when trying to rescue a CentOS server if it becomes inaccessible. We are going to click on Install CentOS 7 to begin the installation process:

how to install centos 7 1810 minimal start menu

Step 5: Selecting Language and Keyboard

CentOS support large number language out of the box. Select proper language and keyboard from this page then click Continue:

how to install centos 7 1810 minimal language select

Step 6: Disk Partitioning

After selecting the language, we will be dropped into the Installation Summary page as follows:

how to install centos 7 1810 minimal install summary

Notice that the Begin Installation button is dim. We cannot proceed till we select destination storage where CentOS is going to be installed. We can select the storage and create proper partitions by clicking on the Installation Destination menu.

By default, CentOS automatically creates necessary partitions on the selected disk. If you want to use the automatic partitioning option simply click on Done.

But if we have a special requirement, for example, using separate mount points for different purposes, we can manually create the partitions. For this tutorial, we are going to create a partition for /home. We start the process by selecting I will configure partitioning then clicking Done. If you have multiple disks, select the appropriate one from the Local Standard Disks box.

how to install centos 7 1810 minimal disk summary

Step 6.1: Partitioning Scheme

From the Manual Partitioning page, we can select 4 partitioning schemes:

  • Standard Partition
  • BTRFS
  • LVM
  • LVM Thin Provisioning

LVM is the most widely used choice since it gives us the freedom to extend the partition in the future using additional disk storages. In this tutorial, we are going to use LVM as a partitioning scheme for the root partitioning.

Step 6.2: Creating Mount Points

A Linux mount point is simply a user accessible link to a partition or a physical device. From the Manual Partitioning page, we are going to click on the + sign to add the first partition for the boot directory. This will be mounted under /boot as the mount point. Clicking on + sign will open a dialog box to enter a Mount Point and Capacity as follows:

how to install centos 7 1810 minimal add mountpoint boot

The Desired Capacity can be in MB or GB as the following formats:

  • 1 GB
  • 1024mb

The mount point box is also a drop-down menu with predefined mount points such as /boot, /, /var, swap, and biosboot. For this example, we are going to select /boot as a mount point and 1 GB as capacity. After entering the mount point and capacity, click on Add mount point button.

Note from the Manual Partitioning summary page that CentOS automatically selected Standard Partition as device type or partitioning schema. This is because the /boot mount point cannot be an LVM.

Next, we will create a mount point to store all the root directory and files under /. From the mount point creation drop down menu, we will select / and enter a capacity of 25 GB:

how to install centos 7 1810 minimal add mountpoint root

Lastly, we are going to create a swap partition by click on + sign again and selecting swap from Mount Point drop-down menu. Since we will use the rest of the available storage space for the swap partition, we will not need to enter a capacity. If the capacity box left blank, the mount point creation process will use all available space.

After creating mount points for boot, root, and swap, the Manual Partitioning page should appear as follows:

how to install centos 7 1810 minimal add mountpoint summary

It is also possible to select other features such as File System type, Encryption, etc for each mount point from this page. By default, CentOS uses XFS file system. To change File System to something else, select the mount point then select a file system type from the dropdown menu.

To enable encryption simply click the Encrypt checkbox. We can also create a new Volume Group on the same page. Click Update Settings after making each change. Note if no additional changes have been made then the Update Settings button will remain dim.

Click Done to finalize the partition creation process. This will open another window displaying all the pending changes. If any mistake has been made, now would be the time to cancel all changes and restart partition creation. If all changes look good, then simply click on Accept Changes.

how to install centos 7 1810 minimal add mountpoint finalize

Step 7: Configuring Network

From Installation Summary, click on Network & Host Name to configure networking. This will bring us to Networking page where we have the option to set the hostname and configure static or DHCP configuration.

how to install centos 7 1810 minimal network

From the network configuration page, select the correct interface then click on Configure to open the network interface configuration dialog box. Most settings in this box can be left as default. But if the server is going to configured with static IP address, then we need to click on the IPv4 Settings tab. Click Method drop-down menu to select Manual, then click Add to enter static IPv4 address, netmask and gateway.

Add necessary DNS servers addresses with space in between multiple server addresses. If IPv6 is going to be used then click on the IPv6 Settings tab and follow the same procedure to add IP information. Once all IP information has been entered click Save.

At the Hostname text box, type in the desired name in FQDN format then click Apply. For our example, we have entered srv1.domain.com.

Lastly, click the On/Off button to enable the configuration for the network interface. If all information has been entered correctly, we should see the IP details on the network summary page as follows:

how to install centos 7 1810 minimal network summary

Click Done to finalize the network configuration to continue with the installation.

Step 8: Configuring Localization

To configure localization click on Date & Time and open the dialog box where we can set date, time and region. If the server will have an internet connection, we can leave the network time enabled so it can sync itself with accurate time.

We can select a region and city from the drop down menu or simply clicking on the map. This will highlight the selected region as follows:

how to install centos 7 1810 minimal localization

Click Done to save and finalize the localization selection. If you see an error message as following on the localization page, that only means the server does not have an established internet connection to check with a time server. This is a common issue if a virtual server or physical server is on VLAN but proper tag has not been set.

how to install centos 7 1810 minimal network no ntp

Step 9: Beginning Installation

At this stage, the Begin Installation button should be active. When ready click on the button to start the installation of the distribution packages.

how to install centos 7 1810 minimal installation

Step 10: Setting Root Credentials

As the installation progresses we have the option to set the root password and create additional users if needed. Click on Root Password to open the password creation dialog box as follows:

how to install centos 7 1810 minimal installation root password

Ensure to use a strong password to better protect your CentOS server. The password strength indicator will let us know if a weak password has been used. Click Done when finished entering the root password.

Step 11: Rebooting CentOS

After packages have been installed, the Reboot button becomes active so we can perform the reboot. Remove the installation media then click on the Reboot button to reboot.

how to install centos 7 1810 minimal installation reboot

Step 12: Updating Distribution

After successful installation and rebooting the server, we should see the command prompt with CentOS version and kernel info as follows:

how to install centos 7 1810 minimal prompt

Login as root using the password entered during installation. Before starting to configure the server, it is best to update the server to the latest packages. Simply run the following command to start updating CentOS:

$ yum update -y

Conclusion

Congratulations! You now have a fully installed CentOS 7.6 minimal. This is just the beginning. A CentOS Linux server can be practically configured to play wide variety role with confidence. Server roles such as Web Server, File Server, Database Server are few most widely used scenarios. After the full update is complete, configuring security is a good place to start.

Latest HOW-TOs