How To Install Centos

How To Install Centos

Reading time1 min
#Linux#Servers#OpenSource#CentOS#MinimalInstall#Sysadmin

Step-by-Step Guide to Installing CentOS with Minimal Footprint for Production Servers

Most installation guides focus on full installations cluttered with unused packages. This guide flips the narrative by prioritizing a lean install, perfect for professionals who demand efficiency and security from the first step.

When deploying production servers, every resource counts. A minimal CentOS installation helps you optimize performance by reducing unnecessary services and packages that consume CPU, memory, and disk space. Moreover, fewer installed components mean a reduced attack surface, improving overall security.

In this practical how-to guide, we'll take you through a straightforward CentOS installation with a minimal footprint — ideal for production environments where stability, security, and efficiency are paramount.


Why Choose a Minimal Installation?

  • Improved Performance: Less bloat means services run faster and the OS boots quicker.
  • Reduced Attack Surface: Installing only essential components lowers vulnerabilities.
  • Simplified Maintenance: Fewer packages lead to fewer updates and dependencies to manage.
  • Resource Efficiency: Frees up CPU, RAM, and storage for your applications.

Prerequisites

Before you start:

  • Hardware — Have your target server or VM ready.
  • CentOS ISO — Download the latest CentOS Minimal ISO from official mirrors.
  • A bootable USB or virtual machine environment ready with the ISO attached.
  • Basic knowledge of Linux command line is helpful but not mandatory.

Step 1: Booting from the CentOS Minimal ISO

  1. Insert your bootable USB or mount the ISO on your VM.
  2. Power on the machine and enter the BIOS/UEFI to set boot priority to your USB/DVD drive.
  3. When you see the CentOS menu, select Install CentOS 7 (or appropriate version) and press Enter.

Step 2: Language and Keyboard Settings

Select your preferred language and keyboard layout as per usual setup steps.


Step 3: Installation Destination (Disk Partitioning)

Choose your server’s hard drive as the installation destination.

For production servers, it's often best practice to configure custom partitions:

  • /boot – 1 GB (primary partition)
  • / (root) – 20–30 GB (depends on application)
  • swap – Typically 1–2x RAM size (or use zram swap)
  • /var, /home, etc. – Optional depending on workload

You can opt for automatic partitioning if you prefer simplicity, but custom partitions provide flexibility.


Step 4: Software Selection — The Core of Minimal Footprint

This is where most users inadvertently add package bloat by selecting the "Server with GUI" or "Workstation" options.

To minimize footprint:

  1. Scroll down in the "Software Selection" screen.
  2. Select Minimal Install under “Base Environment.”
  3. Deselect all add-ons unless absolutely necessary — avoid GUI desktops, development tools unless required.

This installs only core system components required to boot a barebones CentOS system.


Step 5: Network & Hostname Configuration

Configure networking based on your environment:

  • Enable network interfaces (especially important if installing on VMs or physical servers).
  • Assign static IP addresses or DHCP as required.

Set a meaningful hostname suitable for your infrastructure (prod-web01.example.com, for instance).


Step 6: Set Root Password and Create User Account

Set a strong root password for administrative access.

Optionally create an unprivileged user account with sudo rights; this is recommended for safer system management.


Step 7: Begin Installation

Review all settings. Click Begin Installation.

The installer will copy files and setup system based on minimal package selection chosen earlier. This usually completes quickly because fewer packages are installed.


Step 8: Post-Installation First Boot Steps

Once installed, reboot into your new minimal CentOS setup.

Log in either as root or your created user account.

Let’s confirm the minimal install:

# Check installed packages count
rpm -qa | wc -l

You should see a relatively low number (~300 packages), indicating minimal install status.


Optional but Recommended Post-Installation Tips

Enable Firewall (firewalld)

sudo systemctl enable firewalld
sudo systemctl start firewalld
sudo firewall-cmd --state

Disable Unnecessary Services

Check all running services:

sudo systemctl list-unit-files --state=enabled

Disable anything not required — e.g., Bluetooth if installed:

sudo systemctl disable bluetooth.service

Install Only Needed Packages Later

For example, to install OpenSSH server (which may already exist), or nano editor:

sudo yum install openssh-server nano -y

Always think carefully about each package you add on top of minimal install!

Keep System Updated Regularly

sudo yum update -y

Security patches matter even more when running lightweight production systems exposed to external networks!


Recap & Benefits of This Approach

Following this guide results in a clean CentOS environment that:

  • Boots faster with less overhead,
  • Consumes less disk space and memory,
  • Provides fewer vectors for attackers,
  • Is easier to maintain long term,
  • Serves as an ideal base for deploying hardened production workloads like web servers, databases, containers, etc.

You now have full control over what gets added to your server without surprises from pre-installed software packs!


Final Notes

If your production use case involves containers or orchestration tools like Kubernetes, starting from such a lean CentOS build reduces complexity and makes integration smoother.

Stay lean from day one — it pays off in reliability, security, and performance!


Thanks for reading! If you try out this minimal CentOS installation approach on your next server setup or VM deployment, share your experiences below or reach out with questions. Happy installing!