Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Linux / CentOS / CentOS 8: Installation & Basic Configuration Guide

July 1, 2020 CentOSLinuxQuestions and Answers

CentOS 8: Installation & Basic Configuration Guide

In this article we’ll cover the basic steps required to install a clean Linux CentOS 8 from scratch and initial server setup.

Contents:
  • What’s New in CentOS 8?
  • How to Install CentOS 8 from an ISO Image
  • Configuring CentOS 8 Basic Settings after Installation
  • Cockpit: Server Management Web Interface on CentOS 8

What’s New in CentOS 8?

The 8th version of CentOS was released on September 24, 2019. CentOS is a Linux distribution based on the commercial Red Hat Enterprise distro by Red Hat and compatible with it.

Let’s see the main changes in the CentOS 8 release:

  • The Linux kernel 4.18 is used;
  • Transition from yum package manager to dnf. Currently yum exists as a symlink to dnf;
  • The main repository has been divided into 2 ones — BaseOS and AppStream. It has been done in order a user can install different package versions. BaseOS is working as usual;
  • All software has been updated, including the kernel. Now you can install php 7.2 from the basic repository (Finally!);
  • Iptables have been replaced with nftables;
  • Network-scripts are not used by default to configure the network settings. Network Manager should be used to manage a network;
  • By default, the cockpit server management web interface is installed (convenient for newbies);
  • Podman (instead of docker or mobdy) is used to manage containers;
  • A new version of TCP/IP 4.16 stack has appeared to provide higher performance and BBR & NV control algorithm support;
  • New distribution versions.

How to Install CentOS 8 from an ISO Image

Since I installed the CentOS on a KVM virtual machine, I had downloaded an installation ISO image from one of the official mirrors (https://www.centos.org/download/mirrors/) in advance and mounted it to install the OS on a virtual server. (If you want to install CentOS on a physical server, write the installation ISO image on a USB stick.) I will say that the CentOS 8 installation process does not differ from that of the previous version, and this article is intended as a guide for the users who do it for the first time.

The recommended minimum requirements for CentOS 8 installation are at least 10GB of disk space and 712MB RAM per CPU core.

Boot your computer or virtual machine from CentOS install image. In the first step you will be prompted to select further actions. Since we need the installation, select the first item in the menu:

Install CentOS Linux 8.0.1905

install centos 8 from iso imange

After selecting it, the installation process starts:

boot server from centos distoro image

While the necessary software is being loaded, you can just watch the process and do not need to do anything.

When the black screen changes to an interactive one with CentOS logo, keep your keyboard and mouse at hand.

select centos install language

On the welcome screen, you will be prompted to select the language that will be during the installation process. Then click Continue. In the next menu you will select the basic CentOS installation settings.

installation summary screen centos 8

To start the installation, you are required to configure only one item: Installation Destination. There you select the disk partition layout, but I prefer to configure network, time and date at this stage.

select timezone during centos install

Select your settings depending on your time zone.

To configure your network, click Network & Host Name.

configuring ethernet interfaces during centos install

Specify your server name in the Host Name field, and click Configure to configure the network interfaces.

autoactivate LAN on centos with option Automatically connect to this network when it is available

In the General tab, check the box Automatically connect to this network when it is available to automatically start this network interface.

Go to the IPv4 Settings tab (or IPv6 if you are using this protocol) to set the IP address, netmask, gateway and DNS servers:

configuring ipv4 address, mask, gateway and dns servers with centos install wizard

To enter the specific IP address, select Manual method and click Add. After saving the changes, go back to the initial network configuration screen.

configured ens3 ethernet interface (connected)

As you can see in the screenshot, the IP address has been added and the network interface is working (status: Connected).

In the next step, we’ll go to the partitioning of the disk:

select disk to install centos

Just to show the installation process, I used automatic storage configuration by CentOS developers. If you want to partition a disk in some other way, select Custom here.

If your server storage controller does not support a hardware RAID, you can configure a software RAID on your server disks using mdadm.

Since a guest OS had been installed on my virtual machine earlier, the installation saw it. I removed the partitions of the previous operating system in the next menus that appeared:

reclaim space during centos installation

create disk partitions to install centos

You can remove the partitions by clicking Delete all. Then you will have to click Reclaim space to update the size of the available disk space.

The list of packages for the installation is selected in Software Selection. If you are going to use CentOS 8 as a server, it is enough to choose Minimal Install, as well as Standard and Guest Agents (if you install a guest OS on a virtual machine).

After doing that, you can start the installation by clicking Begin Installation.

begin centos installation

During unpacking and installing the required components, you will be prompted to enter a password for the root user. You can also create another user, but it is optional.

configuring centos instance

Click Root Password, enter the password and confirm it. Then click Done to get back to the installation:

set root password

The CentOS 8 installation has taken about 5-7 minutes. When you see Reboot button on the installation screen, it means that the installation is over, and you must restart your server.

centos linux is sucessfully installed

So the CentOS 8 installation is complete.

Configuring CentOS 8 Basic Settings after Installation

Basic CentOS 8 post-install configuration is almost similar to that of CentOS 7, and I configure the same basic settings on all servers.

Install Updates & Administrator Tools on CentOS

As mentioned earlier, dnf has replaced yum in CentOS 8.

Dnf – is the next generation of YUM application, an RPM package manager for Linux distributions. Earlier dnf was used in Fedora distributions, and now it has come to CentOS 8.

The first thing I do on a newly installed server is updating the system:

# dnf update -y

If the image is up-to-date, it is likely that there will be no packages to update, like in my case:

Dependencies resolved.
Nothing to do.
Complete!

If there are any updates, install them.

In the next step, enable the EPEL repository and install the tools for convenient server administration:

# dnf install epel-release -y
# dnf install mc wget screen nano net-tools bind-utils curl lsof vim -y

These utilities are enough for me, but you can install those you got used to.

I do not use automatic system update, since I always install the updates I need manually. If you want to configure automatic updates, install the dnf-automatic package:

# dnf install -y dnf-automatic

To check the active system update tasks, enter this command:

# systemctl list-timers *dnf-*

How to Disable SELinux on CentOS?

At the initial server setup stage, I always disable SELinux (to apply the changes, you will have to reboot your server):

# nano /etc/sysconfig/selinux
# reboot

You can disable SELinux on-the-fly using this command:

setenforce 0

Configuring Network Settings on CentOS 8

Since I configured my network setting during the OS installation, I do not need to do it now (see a detailed article on network configuration in CentOS here). I just want to say that in CentOS 8 you can manage your network using only Network Manager and nmcl. Network-scripts are not supported by default. Frankly speaking, earlier I always disabled NM and did not use it, for it is not convenient for me, but now I will have to learn it.

Here is how to check the network status:

# systemctl status NetworkManager

● NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-06-29 08:23:11 NY; 3h 37min ago
Docs: man:NetworkManager(8)
Main PID: 870 (NetworkManager)
Tasks: 3 (limit: 5060)
Memory: 4.7M
CGroup: /system.slice/NetworkManager.service
└─870 /usr/sbin/NetworkManager --no-daemon

How to Change a Hostname on CentOS 8?

If you have not set a correct server hostname during the CentOS installation or just want to change it, you can do it in some ways. Edit it in the file /etc/hostname or change using the following command:

# hostnamectl set-hostname mycentos8server

Configure Firewalld on CentOS 8

Add the services you will need (SSH and HTTP/HTTPS) to the list of trusted zones in firewalld:

firewall-cmd –-add-service=ssh
firewall-cmd --permanent –-add-service=http
firewall-cmd --permanent –-add-service=https

Changing the time and TimeZone on CentOS

To view the current time and timezone on CentOS, enter the date command:

# date

We set the time-zone during our system installation, so we are having NY time. To change the time-zone, use the corresponding command:

# timedatectl set-timezone America/Toronto

To list all available time zones run the following command:

# timedatectl list-timezones

To synchronize time, chronyd is used, we’ll enable it and add it to autostart using systemctl:

# systemctl start chronyd
# systemctl enable chronyd
# systemctl status chronyd

● chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-06-29 16:13:48 +06; 9s ago
Docs: man:chronyd(8)
man:chrony.conf(5)
Main PID: 31700 (chronyd)
Tasks: 1 (limit: 5060)
Memory: 1.1M
CGroup: /system.slice/chronyd.service
└─31700 /usr/sbin/chronyd

Configure Bash History

To view the bash command history in a more convenient way, I always add a couple of lines to .bashrc to easily get the command history info I need.

With the default settings, the history output is shown like this:

# history

1 dnf repolist
2 dnf install epel-release

It means we can what commands were executed on the server, but do not see the time and date. It is critical for me. So let’s make the history view more convenient. Open /root/.bashrc and add some lines to it:
# nano /root/.bashrc

export HISTSIZE=10000
export HISTTIMEFORMAT="%d/%d/%y - %H:%M:%S "

Then when you view the history, you will see the exact time and date when a command was run:

# history

1 Jun/06/29 - 16:16:29 dnf repolist
2 Jun/06/29 - 16:16:29 dnf install epel-release

Cockpit: Server Management Web Interface on CentOS 8

As we have already mentioned, CentOS 8 has the cockpit server management web interface preinstalled. You can also manage in using systemctl. You can run it and add it to startup:

# systemctl enable cockpit.socket
# systemctl start cockpit.socket

By default, Cockpit web server listens on Port TCP/9090. Add the port to the allowed ones in firewalld:

# firewall-cmd --get-active-zones
# firewall-cmd --add-port=9090/tcp --zone=MY_ACTIVE_ZONE --permanent
# firewall-cmd --reload

To access Cockpit web interface, open this URL: https://Your-CentOS8-IP:9090 in your browser and authenticate.

Cockpit - built-in web management on centos 8

Using Cockpit, you can view the load of your server, manage networks, storages and containers or view the logs.

The typical CentOS server configuration is over, then I usually make further configuration according to my project statement, and the requirements may vary.

0 comment
0
Facebook Twitter Google + Pinterest
previous post
Licensing Mode for Remote Desktop Session Host is not Configured
next post
Keepalived: Configuring High Availability with IP Failover on CentOS/RHEL

Related Reading

Disable Built-in PDF Viewer in Microsoft Edge

February 3, 2023

Join a Windows Computer to an Active Directory...

February 2, 2023

Enable Internet Explorer (IE) Compatibility Mode in Microsoft...

January 27, 2023

How to Disable or Uninstall Internet Explorer (IE)...

January 26, 2023

How to Stop Automatic Upgrade to Windows 11?

January 18, 2023

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Configure User’s Folder Redirection with Group Policy

    February 3, 2023
  • Using Previous Command History in PowerShell Console

    January 31, 2023
  • How to Install the PowerShell Active Directory Module and Manage AD?

    January 31, 2023
  • Finding Duplicate E-mail (SMTP) Addresses in Exchange

    January 27, 2023
  • How to Delete Old User Profiles in Windows?

    January 25, 2023
  • How to Install Free VMware Hypervisor (ESXi)?

    January 24, 2023
  • How to Enable TLS 1.2 on Windows?

    January 18, 2023
  • Allow or Prevent Non-Admin Users from Reboot/Shutdown Windows

    January 17, 2023
  • Fix: Can’t Extend Volume in Windows

    January 12, 2023
  • Wi-Fi (Internet) Disconnects After Sleep or Hibernation on Windows 10/11

    January 11, 2023

Follow us

woshub.com
  • Facebook
  • Twitter
  • RSS
Popular Posts
  • How to Configure MariaDB Master-Master/Slave Replication?
  • KVM: How to Expand or Shrink a Virtual Machine Disk Size?
  • How to Mount Google Drive or OneDrive in Linux?
  • Configuring High Performance NGINX and PHP-FPM Web Server
  • Install and Configure SNMP on RHEL/CentOS/Fedor
  • Adding VLAN Interface in CentOS/Fedora/RHEL
  • Hyper-V Boot Error: The Image’s Hash and Certificate Are not Allowed
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top