Skip to content

AlmaLinux Initial OS Setup Guide

This article provides a practical and minimal initial setup guide for AlmaLinux after a fresh installation, suitable for server environments.

AlmaLinux requires essential system configuration after installation to ensure secure, manageable, and network-accessible operation. These steps establish a solid foundation before deploying any application.

Terminal window
hostnamectl set-hostname your-hostname
echo "127.0.0.1 localhost your-hostname" >> /etc/hosts

Step 2: Configure Network (Example: Static IP)

Section titled “Step 2: Configure Network (Example: Static IP)”
Terminal window
nmcli con mod "eth0" ipv4.addresses 192.168.1.100/24
nmcli con mod "eth0" ipv4.gateway 192.168.1.1
nmcli con mod "eth0" ipv4.dns 8.8.8.8
nmcli con mod "eth0" ipv4.method manual
nmcli con up "eth0"
Terminal window
cat <<EOF > /etc/profile.d/proxy.sh
export http_proxy="http://proxy.example.com:8080"
export https_proxy="http://proxy.example.com:8080"
export no_proxy="localhost,127.0.0.1"
EOF
chmod +x /etc/profile.d/proxy.sh
source /etc/profile.d/proxy.sh
echo 'proxy=http://proxy.example.com:8080' >> /etc/dnf/dnf.conf
Terminal window
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
setenforce 0
Terminal window
dnf update -y
dnf upgrade -y
Terminal window
systemctl enable --now firewalld
firewall-cmd --permanent --add-service=ssh
firewall-cmd --reload
Terminal window
timedatectl set-timezone Asia/Tokyo
systemctl enable --now chronyd
Terminal window
useradd adminuser
passwd adminuser
usermod -aG wheel adminuser
mkdir -p /home/adminuser/.ssh
chmod 700 /home/adminuser/.ssh
vi /home/adminuser/.ssh/authorized_keys # Paste public key
chmod 600 /home/adminuser/.ssh/authorized_keys
chown -R adminuser:adminuser /home/adminuser/.ssh
Terminal window
reboot

This minimal setup prepares an AlmaLinux system for secure and reliable server use. It includes hostname configuration, network and proxy setup, system updates, essential tooling, SELinux disablement, and firewall and time settings.