Minimal Centos 7 Install
Intro
I aim to keep my systems as simple and maintainable as possible. These are the steps I typically follow when building a new Centos server.
Creating a bootable USB drive
In most cases, booting from USB is the simplest way to install Centos. I recommend downloading the minimal ISO from the official Centos website, as it’s smaller and we don’t need any of the extras. Next up, create a bootable USB drive. On Windows, I like to use Rufus.
Installation
Once the USB drive is ready, plug it in and fire up your server. You can usually trigger the boot menu by pressing one of the function keys like F12 during bios start up.
After selecting your language, select ‘Network & Host Name’.
Select the network interface you would like to have start at boot, and turn it on.
Set the hostname, apply, then select ‘Done’ in the top left.
Select ‘Installation Destination’.
Select the disk and select the ‘I will configure partitioning’ option, then select ‘Done’.
Delete any existing partitions on the disk, then ‘Click here to create them automatically’.
Delete the /home partition, select the root (/) partition and set the Desired Capacity to 100%.
Click Done, Accept Changes then Begin Installation.
While the installation is in progress, set a root password, then hit the reboot button when the installation is complete.
Post installation configuration
There’s a few things I like to configure on every new Centos install.
First up, updates:
yum update
Install nano and epel-release:
yum install nano epel-release
Configure automatic updates:
yum install yum-cron
nano /etc/yum/yum-cron.conf
update_cmd = security
apply_updates = yes
systemctl status yum-cron.service
systemctl start yum-cron.service
Configure the hostname if you didn’t during install:
hostnamectl set-hostname homelab
Configure a static IP:
nano /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
NM_CONTROLLED=NO
ONBOOT=YES
BOOTPROTO=none
IPADDR=192.168.1.6
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=192.168.1.1
DNS2=192.168.1.1
Finally, reboot:
reboot