Linux Intermediate

Complete Linux OS Installation Guide for All Major Distributions

By VCCLHOSTING Team
18,934 views
30 min read
4.8

Linux Operating System Installation

This comprehensive guide covers installation procedures for all major Linux distributions. VCCLHOSTING supports all these distributions on our dedicated servers and VPS plans.

Ubuntu Server Installation

Download Ubuntu Server

# Download Ubuntu Server 22.04 LTS
wget https://releases.ubuntu.com/22.04/ubuntu-22.04-live-server-amd64.iso

# Verify checksum
sha256sum ubuntu-22.04-live-server-amd64.iso

Installation Steps

  1. Boot from installation media
  2. Select language and keyboard layout
  3. Configure network settings
  4. Set up disk partitioning
  5. Create user account
  6. Install SSH server
  7. Complete installation

Post-Installation Configuration

# Update system
sudo apt update && sudo apt upgrade -y

# Install essential packages
sudo apt install -y vim curl wget git htop net-tools openssh-server

# Configure hostname
sudo hostnamectl set-hostname your-hostname

# Configure timezone
sudo timedatectl set-timezone Asia/Kolkata
timedatectl

# Configure firewall
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
sudo ufw status

CentOS/AlmaLinux/Rocky Linux Installation

Download ISO

# AlmaLinux 9
wget https://repo.almalinux.org/almalinux/9/isos/x86_64/AlmaLinux-9-latest-x86_64-dvd.iso

# Rocky Linux 9
wget https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9-latest-x86_64-dvd.iso

Post-Installation Setup

# Update system
sudo dnf update -y

# Install EPEL repository
sudo dnf install epel-release -y

# Install essential packages
sudo dnf install -y vim curl wget git htop net-tools

# Configure hostname
sudo hostnamectl set-hostname your-hostname

# Configure firewall
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload
sudo firewall-cmd --list-all

# Disable SELinux (if needed)
sudo sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
sudo setenforce 0

Debian Installation

Download Debian

# Download Debian 12 (Bookworm)
wget https://cdimage.debian.org/debian-cd/current/amd64/iso-dvd/debian-12.0.0-amd64-DVD-1.iso

Post-Installation

# Update system
sudo apt update && sudo apt upgrade -y

# Install sudo (if not installed)
su -
apt install sudo
usermod -aG sudo your-username
exit

# Install essential packages
sudo apt install -y vim curl wget git htop net-tools ssh

# Configure network (if using netplan)
sudo nano /etc/netplan/01-netcfg.yaml

# Apply network configuration
sudo netplan apply

Arch Linux Installation

Base Installation

# Connect to internet
iwctl
station wlan0 connect SSID

# Partition disk
fdisk /dev/sda

# Format partitions
mkfs.ext4 /dev/sda1
mkswap /dev/sda2
swapon /dev/sda2

# Mount partitions
mount /dev/sda1 /mnt

# Install base system
pacstrap /mnt base linux linux-firmware

# Generate fstab
genfstab -U /mnt >> /mnt/etc/fstab

# Chroot into system
arch-chroot /mnt

# Set timezone
ln -sf /usr/share/zoneinfo/Asia/Kolkata /etc/localtime
hwclock --systohc

# Install bootloader
pacman -S grub
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

# Set root password
passwd

# Create user
useradd -m -G wheel username
passwd username

# Install sudo
pacman -S sudo
EDITOR=nano visudo  # Uncomment %wheel line

# Reboot
exit
umount -R /mnt
reboot

Fedora Server Installation

Post-Installation Setup

# Update system
sudo dnf update -y

# Install essential packages
sudo dnf install -y vim curl wget git htop

# Configure firewall
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload

Automated Installation Scripts

Ubuntu Kickstart

# Create preseed file for automated Ubuntu installation
cat > preseed.cfg << 'EOF'
d-i debian-installer/locale string en_US
d-i keyboard-configuration/xkb-keymap select us
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string ubuntu-server
d-i netcfg/get_domain string local
d-i mirror/country string manual
d-i mirror/http/hostname string archive.ubuntu.com
d-i mirror/http/directory string /ubuntu
d-i partman-auto/method string regular
d-i partman-auto/choose_recipe select atomic
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i passwd/user-fullname string Admin User
d-i passwd/username string admin
d-i passwd/user-password password changeme
d-i passwd/user-password-again password changeme
EOF

CentOS/RHEL Kickstart

# Create kickstart file
cat > ks.cfg << 'EOF'
#version=RHEL9
install
text
url --url="http://mirror.centos.org/centos/9-stream/BaseOS/x86_64/os/"
keyboard us
lang en_US.UTF-8
network --bootproto=dhcp --device=eth0
rootpw --plaintext changeme
firewall --enabled --service=ssh
selinux --disabled
timezone Asia/Kolkata
bootloader --location=mbr
clearpart --all --initlabel
autopart
reboot

%packages
@core
@base
vim
wget
curl
%end

%post
yum update -y
%end
EOF

Post-Installation Security Hardening

# Disable root login via SSH
sudo sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config
sudo systemctl restart sshd

# Install and configure fail2ban
sudo apt install fail2ban  # Ubuntu/Debian
sudo dnf install fail2ban  # CentOS/RHEL

# Configure fail2ban
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
sudo systemctl enable fail2ban
sudo systemctl start fail2ban

# Set up automatic security updates (Ubuntu)
sudo apt install unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades

# Configure automatic updates (CentOS)
sudo dnf install dnf-automatic
sudo systemctl enable --now dnf-automatic.timer

Conclusion

This guide covers installation procedures for all major Linux distributions. VCCLHOSTING provides pre-installed Linux servers with your choice of distribution, saving you installation time.

Need Professional Hosting?

VCCLHOSTING provides enterprise-grade hosting solutions with 24/7 support, 99.9% uptime SLA, and ISO 27001 certification. Get started today!