Web Server

Unlimited Guide To CentOS Stream 9 Installation, Configuration, and Usage

Unlimited Guide To CentOS Stream 9 Installation, Configuration, and Usage

Users were furious when Red Hat changed CentOS from a major release structure to a rolling release, but CentOS operated without a hitch. Recently, they released CentOS Stream, a new release created in partnership with Red Hat engineers and the community.

So let’s understand whether you should rely on CentOS Stream and what it offers in its latest release before moving on to the installation section.

 

Is CentOS Stream 9 Stable?

Stability-wise, you shouldn’t compare CentOS Stream 9 to other rolling releases like Arch Linux because you won’t get the newest packages in CentOS as opposed to Arch. Before being made available for CentOS, the packages will be tested on Fedora and will provide you with the stability that CentOS Stream 9 is known for.

As CentOS has ultimately become RHEL, we can collaborate with RHEL Engineers and have a better influence on future releases of RHEL and CentOS Stream.

 

What’s New in CentOS Stream 9

Now, let’s talk about what’s new in CentOS Stream.

  • The project shifted from a major release to a rolling release.
  • GNOME 40
  • Python 3.9
  • GCC 11.2
  • MariaDB 10.5
  • Nginx 1.20

Many important packages such as PHPOpenSSHMySQL, and others have also been updated.

 

How to Install CentOS Stream 9

System Requirements

Before you begin, make sure your system meets the minimum hardware requirements for CentOS Stream 9. These requirements can vary depending on your use case but generally include a 64-bit processor, at least 2 GB of RAM, and sufficient storage.

Download CentOS Stream 9

Visit the official CentOS Stream website to download the latest ISO image for CentOS Stream 9.

Create Bootable Media

You can create a bootable USB drive or burn the ISO to a DVD using tools like Rufus or Ventoy (for USB) or your preferred burning software (for DVD).

Install CentOS Stream 9

Insert the bootable media into your system, boot from it, and follow the installation wizard:

CentOS Stream Boot Menu

  1. Choose Installer Language:

    You are free to select whatever makes you feel most comfortable, but since English will be the most common language, we are going with that.

  2. Setting Up Localization:

    Here we will configure all the available options under the Localization section which are KeyboardLanguage Support, and Time & Date.
    Setting Up Localization

  3. Setting Up Software Options:

    You can choose the essential tools you need from this point on. I will choose one of the first four options. The minimal installation is another option; it will omit the GUI and provide a custom OS option.
    Setting Up Software Options

  4. Choose Installation Drive:

    Choose the preferred disc. When it comes to drive partitioning, you have two choices: automatic and manual. Although the other option allows you to customize partitions, we would recommend automatic partitioning as it manages size well.

  5. Setting Network and Hostname:

    We will assign the hostname to our system and configure networking in this step. Then select “Network & Hostname.”
    All you need to do to use Ethernet is press the designated button to turn it on. You are given a separate section in which to assign the hostname. I’m going to use tecmint in my situation.

    Setting Network and Hostname

    Click Configure to be directed to manually configure our network if you are not using DHCP. Click on IPv4 from this page and select the Manual method. Click the Add button to add the desired Address, Netmask, and Gateway. Add DNS and save the configuration at the end.
    CentOS Stream Manual Network Configure

  6. Create a User Account:

    To create a user, click on the User creation option which will direct you to a prompt where you are going to add users and create a password.
    Create a User Account

Click on the Begin installation button and it will start the installation process. Once the installation is complete, click on Reboot System.

 

How to Configure CentOS Stream 9?

Configuring CentOS Stream 9 involves setting up various system settings and services to tailor the system to your needs. Here’s a step-by-step guide to configuring CentOS Stream 9:

Note: Make sure you have administrative privileges (root access) when performing system configurations.

  • Update System Packages:

    Ensure your system is up-to-date to patch security vulnerabilities and update software packages:

    bash
    dnf update
  • Set Hostname:

    Edit the /etc/hostname file to set your system’s hostname:

    bash
    echo "yourhostname" > /etc/hostname

    Then, update /etc/hosts with your hostname and IP address.

  • Configure Network:

    Use NetworkManager or nmtui to configure your network interfaces. Restart the network service after making changes:

    bash
    systemctl restart NetworkManager
  • User Management:

    Create additional users and groups as needed. Add users to groups using usermod. Set passwords with passwd.

  • Firewall Configuration (firewalld):

    • Enable firewalld:
      bash
      systemctl enable firewalld
    • Start firewalld:
      bash
      systemctl start firewalld
    • Open ports (e.g., allow SSH):
      bash
      firewall-cmd --add-service=ssh --permanent
    • Reload firewall rules:
      bash
      firewall-cmd --reload
  • SSH Configuration:

    Edit SSH configuration to enhance security or customize settings:

    bash
    nano /etc/ssh/sshd_config

    Make your changes and save the file, then restart the SSH service:

    bash
    systemctl restart sshd
  • Systemd Services:

    • Start a service (replace service-name with the actual service name):
      bash
      systemctl start service-name
    • Stop a service:
      bash
      systemctl stop service-name
    • Enable a service at boot:
      bash
      systemctl enable service-name
    • Disable a service at boot:
      bash
      systemctl disable service-name
    • Check service status:
      bash
      systemctl status service-name
  • SELinux Configuration:

    • Check SELinux status:
      bash
      sestatus
    • Change SELinux mode (e.g., to permissive):
      bash
      setenforce 0
    • Edit SELinux policy using tools like semanage and audit2allow if needed.
  • System Time and Date:

    Set the correct time zone and synchronize your system’s clock with network time servers:

    bash
    timedatectl set-timezone your-timezone
    systemctl restart systemd-timesyncd
  • Customize Bash Prompt:

    Customize your shell prompt by editing the .bashrc or .bash_profile file in your home directory.

  • Add Additional Software:

    Use dnf to install additional software packages as needed:

    bash
    dnf install package-name
  • Backup and Monitoring:

    Implement regular backups and monitoring solutions based on your system’s requirements.

  • Additional Configuration:

    Depending on your specific use case, you may need to configure additional services, such as web servers, databases, or application-specific settings.

  • Security Hardening:

    Follow best practices for security hardening, such as disabling unnecessary services, setting strong passwords, and keeping software up-to-date.

  • Documentation:

    Document your system configurations and changes for future reference.

 

Basic Usage of CentOS Stream 9

Package Management (DNF):

  • Install a package: dnf install package-name
  • Remove a package: dnf remove package-name
  • Update all packages: dnf update
  • Search for packages: dnf search package-name
  • List installed packages: dnf list installed
  • Clean cache: dnf clean all

File System Navigation:

  • Navigate directories: cd directory-name
  • List files and directories: ls
  • Display current directory: pwd
  • Create a directory: mkdir directory-name
  • Remove a file or directory: rm file-or-directory-name

Basic Commands:

  • Display system information: uname -a
  • View system logs: journalctl
  • Check disk space: df -h
  • Check system resources: top or htop
  • Edit files: Use vi, nano, or vim

 

Advanced Usage of CentOS Stream 9

Firewall Configuration (firewalld):

  • Enable firewalld: systemctl enable firewalld
  • Start firewalld: systemctl start firewalld
  • Open ports: firewall-cmd --add-port=port/tcp --permanent
  • Reload firewall: firewall-cmd --reload
  • Check the status: firewall-cmd --state

SSH Configuration:

  • Edit SSH configuration: /etc/ssh/sshd_config
  • Restart SSH service: systemctl restart sshd

Systemd Services:

  • Start a service: systemctl start service-name
  • Stop a service: systemctl stop service-name
  • Enable a service at boot: systemctl enable service-name
  • Disable a service at boot: systemctl disable service-name
  • Check service status: systemctl status service-name

SELinux Configuration:

  • Check SELinux status: sestatus
  • Change SELinux mode (e.g., to permissive): setenforce 0
  • Edit SELinux policy: semanage and audit2allow

This guide provides an overview of CentOS Stream 9 installation, basic configuration, basic usage, and some advanced topics. To explore further, refer to CentOS documentation, for more detailed instructions on specific tasks and customization options based on your specific use case.

Leave a Reply

Your email address will not be published. Required fields are marked *