We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

Learn how to – Install Rocky Linux 8 on Hetzner Root Server

Learn how to – Install Rocky Linux 8 on Hetzner Root Server.

Rocky Linux is a very powerful and widely adopted open-source enterprise operating system designed from Red Hat Enterprise Linux® sources. Development of Rocky Linux is done by an active community with thousands of users willing to commit hours in writing code, reporting bug issues, writing documentation pages, and spreading the good news on Rocky Linux around the world.

In this article we’ll perform an installation of Rocky Linux 8 on Hetzner Root Server(s). Hetzner root servers gives you excellent performance and high availability of your hosted services. You can choose from a variety of Dedicated server offerings to host your applications on dedicated hardware or through virtualization.

Our installation of Rocky Linux 8 is performed on a Hetzner Root Server with the following hardware specifications:

  • CPU:  Intel(R) Xeon(R) CPU E3-1275 v5 @ 3.60GHz (Cores 8)
  • Memory: 64GB RAM
  • Disk: 2 x 480 GB SSDs
  • Network Interface: 1Gbit
  • IPV4 Address: 1 x IPV4 Public Address

When you order a dedicated root server from hetzner, you’ll get a single Public IPv4 address. For services that require additional public IP address, you’ll make an official from the wen portal once the server has been provisioned. You’re encouraged to use IPv6 which is free of charge.

#1 – Activate rescue system

Login into Hetzner console to access your root server management functions. To put the server in Rescue system, navigate to;

Main functions > Servers > Server Label > Rescue. From there choose an operating system and CPU architecture of the rescue environment.

Access to rescue system can be through SSH password authentication or SSH public key. Default user account is root. Once done, hit the “Activate rescue system” button.

Reboot the server under “Reset” menu, then “Execute an automatic hardware reset” > “Send

#2 – Create Root Server Configuration

Wait for the server to come online then SSH to it using root user and password shown during Rescue activation / SSH pubkey. For ssh key based authentication, no password is required to access server’s shell.

$ ssh root@serverip
Enter passphrase for key '/Users/learnhowto/.ssh/id_rsa':
Linux rescue 5.16.5 #1 SMP Mon Feb 7 07:50:07 UTC 2022 x86_64

----------------------------------------------------------------------

  Welcome to the Hetzner Rescue System.

  This Rescue System is based on Debian GNU/Linux 11 (bullseye) with
  a custom kernel. You can install software as in a normal system.

  To install a new operating system from one of our prebuilt
  images, run 'installimage' and follow the instructions.

  More information at https://docs.hetzner.com/

----------------------------------------------------------------------

Rescue System up since 2022-06-20 15:27 +02:00

Last login: Tue Jun 21 16:50:21 2022 from 197.231.176.230
Hardware data:

   CPU1: Intel(R) Xeon(R) CPU E3-1275 v5 @ 3.60GHz (Cores 8)
   Memory:  64104 MB
   Disk /dev/sda: 480 GB (=> 447 GiB) doesn't contain a valid partition table
   Disk /dev/sdb: 480 GB (=> 447 GiB) doesn't contain a valid partition table
   Total capacity 894 GiB with 2 Disks

Network data:
   eth0  LINK: yes
         MAC:  90:1b:0e:b6:e6:1a
         IP:   88.99.162.204
         IPv6: 2a01:4f8:10a:332f::2/64
         Intel(R) PRO/1000 Network Driver

root@rescue ~ #

The server we’re using have two disks;

  • /dev/sda
  • /dev/sdb

We’ll configure the two disks in a non-redundant RAID 0 (striping) configuration. The OS image to be used is:

root@rescue ~ # ls /root/images/Rocky*
/root/images/Rocky-85-amd64-base.tar.gz  /root/images/Rocky-85-amd64-base.tar.gz.sig

Here are the Hetzner server configuration contents to be used by installimage:

root@rescue ~ # vim  rocky-install-config.txt
DRIVE1 /dev/sda
DRIVE2 /dev/sdb
SWRAID 1          # Enable software Raid
SWRAIDLEVEL 0  # Use software raid level 0
BOOTLOADER grub
HOSTNAME myserver.ownyourlife.com.ng #Server hostname
PART /boot/efi esp 512M
PART /boot ext4 800M
PART lvm vg0 all #Create LVM Volume group which uses all space

### Customize disk allocations accordingly ###
LV vg0 root / xfs 50G          # /root space allocation
LV vg0 swap swap swap 8G       # swap space allocation
LV vg0 var /var  xfs  100G     # /var space allocation

IMAGE /root/images/Rocky-85-amd64-base.tar.gz

#3 – Install Rocky Linux 8 on Hetzner Root Server

Now that we have a template for OS installation using installimage script, we can initiate Rocky Linux 8 deployment on Hetzner root server using the command below:

root@rescue ~ # installimage -a -c rocky-install-config.txt

Fixing the error “ERROR: Value for CRYPTPASSWORD is not defined

# Add to your config file
CRYPTPASSWORD CryptPassword01

# Then run  installimage -a -c rocky-install-config.txt

Installation process should begin in few seconds.

Found AUTOSETUP file '/autosetup'
Running unattended installimage installation ...
....
WARNING:
  Starting installation in 20 seconds ...
  Press X to continue immediately ...
  Installation will DELETE ALL DATA ON DISK(s)!
  Press CTRL-C to abort now!
  => ......

Here’s the output of a successful installation of Rocky Linux 8 on hetzner root server.

Hetzner Online GmbH - installimage

  Your server will be installed now, this will take some minutes
             You can abort at any time with CTRL+C ...

         :  Reading configuration                           done
         :  Loading image file variables                    done
         :  Loading rockylinux specific functions           done
   1/18  :  Deleting partitions                             done
   2/18  :  Test partition size                             done
   3/18  :  Creating partitions and /etc/fstab              done
   4/18  :  Creating software RAID level 0                  done
   5/18  :  Encrypt partitions and create /etc/crypttab     done
   6/18  :  Creating LVM volumes                            done
   7/18  :  Formatting partitions
         :    formatting /dev/md/0 with ext4                done
         :    formatting /dev/vg0/root with xfs             done
         :    formatting /dev/vg0/swap with swap            done
         :    formatting /dev/vg0/tmp with xfs              done
   8/18  :  Mounting partitions                             done
   9/18  :  Sync time via ntp                               done
         :  Importing public key for image validation       done
  10/18  :  Validating image before starting extraction     done
  11/18  :  Extracting image (local)                        done
  12/18  :  Setting up network config                       done
  13/18  :  Executing additional commands
         :    Setting hostname                              done
         :    Generating new SSH keys                       done
         :    Generating mdadm config                       done
         :    Generating ramdisk                            done
         :    Generating ntp config                         done
  14/18  :  Setting up miscellaneous files                  done
  15/18  :  Configuring authentication
         :    Fetching SSH keys                             done
         :    Disabling root password                       done
         :    Disabling SSH root login without password     done
         :    Copying SSH keys                              done
  16/18  :  Installing bootloader grub                      done
  17/18  :  Running some rockylinux specific functions      done
  18/18  :  Clearing log files                              done

                  INSTALLATION COMPLETE
   You can now reboot and log in to your new system with the
 same credentials that you used to log into the rescue system.

Reboot the server to use Rocky Linux 8 operating system we just installed:

root@rescue ~ # shutdown -r now

#4 – Use Rocky Linux 8 on Hetzner Root Server

Login to your Rocky Linux 8 server and check OS information.

[root@myserver ~]# cat /etc/os-release
NAME="Rocky Linux"
VERSION="8.5 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.5"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.5 (Green Obsidian)"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:rocky:rocky:8:GA"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
ROCKY_SUPPORT_PRODUCT="Rocky Linux"
ROCKY_SUPPORT_PRODUCT_VERSION="8"

Let’s update OS packages to the latest releases and install basic utilities.

sudo dnf -y update
sudo dnf -y install epel-release vim wget curl bash-completion

We can install neofetch from EPEL repo

sudo dnf -y install neofetch

This is a screenshot of our neofetch output:

Wrapping up

In this blog post we’ve demonstrated how installation of Rocky Linux 8 can be done on Hetzner root server hardware. We also perform post-installation tasks such as OS updates and installation of common system management utilities. In our future guides we’ll cover custom ISO installation of operating systems on Hetzner. until then stay connected by checking regular updates on our website. Cheers!

More guides on Hetzner Cloud:

Cart

Your Cart is Empty

Back To Shop