Installing AlmaLinux 9

From Server rental store
Jump to navigation Jump to search

Installing AlmaLinux 9

This guide provides step-by-step instructions for installing AlmaLinux 9, a free, enterprise-grade, community-supported fork of Red Hat Enterprise Linux (RHEL). It covers the installation process and essential initial configuration steps to get your server up and running.

AlmaLinux 9 is an excellent choice for servers requiring stability, security, and long-term support. It's well-suited for a wide range of applications, from web servers to database servers and development environments. For those seeking powerful hardware for their AlmaLinux deployments, consider dedicated servers from PowerVPS, offering full root access and optimal performance.

Prerequisites

Before you begin the installation, ensure you have the following:

  • A server or workstation with bootable media (USB drive or ISO image).
  • A stable internet connection for downloading packages.
  • Basic knowledge of server hardware and operating system installation.
  • A keyboard and monitor connected to the server, or remote console access.
  • If installing on a dedicated server, ensure you have the necessary boot media uploaded or accessible via your provider's control panel. PowerVPS provides easy ways to upload ISOs for custom installations.

Downloading AlmaLinux 9

1. Visit the official AlmaLinux download page: [1](https://almalinux.org/download/) 2. Choose the appropriate installer for your architecture (typically x86_64 for most servers). You can download the full ISO or a minimal boot image. For a server, the minimal ISO is often preferred to reduce the attack surface and install only necessary packages. 3. Verify the integrity of the downloaded file using its checksum (SHA256, MD5) provided on the download page.

Creating Bootable Media

Once you have the ISO image, you need to create bootable media.

For USB Drives

On Linux:

sudo dd if=/path/to/AlmaLinux-9.x-x86_64-dvd1.iso of=/dev/sdX bs=4M status=progress

Replace `/path/to/AlmaLinux-9.x-x86_64-dvd1.iso` with the actual path to your ISO file and `/dev/sdX` with your USB drive device (e.g., `/dev/sdb`). Be extremely careful to select the correct device, as an incorrect choice can erase data from another drive.

On Windows: Use a tool like Rufus ([2](https://rufus.ie/)) or balenaEtcher ([3](https://www.balena.io/etcher/)) to write the ISO to your USB drive.

For Virtual Machines / Cloud

For virtual machines or cloud instances, you can often directly attach the ISO image to the virtual CD/DVD drive and boot from it.

Installation Process

1. **Boot from Installation Media**: Insert your bootable media into the server and reboot. Ensure your BIOS/UEFI is configured to boot from the USB drive or CD/DVD drive. 2. **Select Installation Option**: You will be presented with a boot menu. Choose "Install AlmaLinux 9". 3. **Language Selection**: Select your preferred language for the installation process and click "Continue". 4. **Installation Summary**: This is the main configuration screen. You'll need to configure several options:

   *   **Local Sources**: Usually, this is automatically detected if you booted from the ISO.
   *   **Time & Date**: Set your server's timezone.
   *   **Keyboard**: Select your keyboard layout.
   *   **Language Support**: Add any additional languages if needed.
   *   **Installation Source**: Ensure "Local media" is selected.
   *   **Software Selection**: This is crucial. For a server, it's recommended to select "Minimal Install". You can add additional software groups later if needed. For specific roles, consider groups like "Server with GUI" (if you need a graphical interface) or "Web Server".
   *   **Installation Destination**:
       *   Click on "Installation Destination".
       *   Select your disk.
       *   Choose "Automatic" partitioning for simplicity, or "Custom" if you need specific partition layouts (e.g., separate `/home`, `/var`). For beginners, "Automatic" is usually sufficient.
       *   Click "Done".
   *   **Network & Hostname**:
       *   Click on "Network & Hostname".
       *   Enter a hostname for your server (e.g., `almalinux-server`).
       *   Ensure your network interface is configured correctly (usually DHCP by default). If you need a static IP address, click the gear icon next to your network interface and configure the IPv4 settings.
       *   Click "Done".
   *   **Security Policy**: (Optional) You can configure security profiles here.
   *   **KDUMP**: (Optional) Enable or disable kernel dump. It's usually recommended to leave it enabled for debugging.

5. **Begin Installation**: Once all options are configured, click "Begin Installation". 6. **Root Password**: While the installation proceeds, click on "Root Password" and set a strong password for the root user. 7. **User Creation**: (Optional but recommended) Click on "User Creation" to create a non-root user with administrative privileges (using `sudo`). Enter a username and a strong password. 8. **Installation Complete**: After the installation finishes, you will see a "System is Ready" message. Click "Finish Installation". 9. **Reboot**: Remove the installation media and reboot your server.

Initial Configuration

After the first boot, you'll need to perform some essential configuration steps.

Logging In

You can log in as the `root` user or the regular user you created. It's generally recommended to log in as a regular user and use `sudo` for administrative tasks.

Updating the System

It's crucial to update your system to the latest packages.

sudo dnf update -y

Enabling SSH

SSH is usually enabled by default, but ensure it's running and accessible.

sudo systemctl enable sshd
sudo systemctl start sshd
sudo systemctl status sshd

To allow SSH connections from external networks, you might need to adjust the firewall.

Firewall Configuration

AlmaLinux 9 uses `firewalld` by default. To allow SSH (port 22):

sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --reload

To allow HTTP (port 80) and HTTPS (port 443) for a web server:

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload

To check the active firewall rules:

sudo firewall-cmd --list-all

SELinux

SELinux (Security-Enhanced Linux) is enabled by default and is a powerful security mechanism. You can check its status:

sestatus

If you need to temporarily disable SELinux for troubleshooting (not recommended for production):

sudo setenforce 0

To permanently disable SELinux (requires reboot, not recommended): Edit `/etc/selinux/config` and set `SELINUX=disabled`.

Network Configuration (Static IP)

If you need to configure a static IP address manually: 1. Identify your network interface name (e.g., `eth0`, `enp1s0`) using `ip a`. 2. Edit the network configuration file. For example, for `eth0`:

    sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0
    

3. Add or modify the following lines:

    BOOTPROTO="static"
    IPADDR="192.168.1.100"
    NETMASK="255.255.255.0"
    GATEWAY="192.168.1.1"
    DNS1="8.8.8.8"
    ONBOOT="yes"
    
   Replace the IP addresses and subnet mask with your network's details.

4. Restart the network service:

    sudo systemctl restart network
    
   Alternatively, you can use `nmcli` for network configuration.

Troubleshooting

  • **Installation hangs**: Ensure your bootable media is not corrupted and your hardware is compatible. Try a different USB port or a different USB drive.
  • **Network issues after installation**: Double-check your network configuration, firewall rules, and ensure the network service is running.
  • **Cannot log in**: Verify your username and password. If you forgot the root password, you may need to boot into rescue mode to reset it.
  • **Package installation errors**: Ensure your system is updated and has access to the AlmaLinux repositories. Check your `/etc/yum.repos.d/` directory.

Related Articles