How to install Cockpit on Rocky Linux 8

Share on Social Media

Step by Step guide to install Cockpit on Rocky Linux 8 and other RPM based distros. #centlinux #linux #cockpit

What is Cockpit? :

Cockpit is a web-based graphical interface for servers, intended for everyone, especially those who are:

  • new to Linux (including Windows admins) familiar with Linux and want an easy, graphical way to administer servers.
  • expert admins who mainly use other tools but want an overview on individual systems.

Cockpit is an easy-to-use, lightweight, and simple yet powerful remote manager for GNU/Linux servers, it’s an interactive server administration user interface that offers a live Linux session via a web browser.

Video to install Cockpit on Rocky Linux 8:

YouTube player

Environment Specification:

We are using a minimal Rocky Linux 8 virtual machine with following specifications.

  • CPU – 3.4 Ghz (2 cores)
  • Memory – 2 GB
  • Storage – 20 GB
  • Operating System – Rocky Linux 8.5 (Green Obsidian)
  • Hostname – rockylinux-01.centlinux.com
  • IP Address – 192.168.116.128 /24

Updating Rocky Linux:

Connect with rockylinux-01.centlinux.com as root user by using a ssh client.

Execute following command to build cache for installed yum repositories.

# dnf makecache
Rocky Linux 8 - AppStream                       1.5 kB/s | 4.8 kB     00:03
Rocky Linux 8 - BaseOS                          1.7 kB/s | 4.3 kB     00:02
Rocky Linux 8 - Extras                          1.9 kB/s | 3.5 kB     00:01
Metadata cache created.

As a best practice, update software packages in your Linux operating system before installing Cockpit web interface.

# dnf update -y
Last metadata expiration check: 0:00:49 ago on Mon 21 Feb 2022 07:39:22 PM PKT.
Dependencies resolved.
Nothing to do.
Complete!

Our Linux server is already up-to-date. The result may vary on your operating system.

Check the Linux Kernel and operating system version, being used in this installation guide.

# uname -r
4.18.0-348.12.2.el8_5.x86_64

# 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"

Install Cockpit on Rocky Linux:

In Rocky Linux 8, Cockpit software is available in standard yum repositories. Therefore, you can easily install it by executing a dnf command.

# dnf install -y cockpit

After successful installation of web GUI management software, enable and start Cockpit service.

# systemctl enable --now cockpit.socket
Created symlink /etc/systemd/system/sockets.target.wants/cockpit.socket → /usr/lib/systemd/system/cockpit.socket.

Check the status of Cockpit service.

# systemctl status cockpit.socket
● cockpit.socket - Cockpit Web Service Socket
   Loaded: loaded (/usr/lib/systemd/system/cockpit.socket; enabled; vendor pres>
   Active: active (listening) since Mon 2022-02-21 19:48:06 PKT; 34s ago
     Docs: man:cockpit-ws(8)
   Listen: [::]:9090 (Stream)
  Process: 2150 ExecStartPost=/bin/ln -snf active.motd /run/cockpit/motd (code=>
  Process: 2143 ExecStartPost=/usr/share/cockpit/motd/update-motd  localhost (c>
    Tasks: 0 (limit: 5808)
   Memory: 4.0K
   CGroup: /system.slice/cockpit.socket

Feb 21 19:48:06 rockylinux-01.centlinux.com systemd[1]: Starting Cockpit Web Se>
Feb 21 19:48:06 rockylinux-01.centlinux.com systemd[1]: Listening on Cockpit We>

Configure Linux Firewall:

Cockpit uses default service port 9090/tcp. Therefore, you may have to enable this port or enable predefined cockpit service in Linux firewall.

# firewall-cmd --permanent --add-service=cockpit
Warning: ALREADY_ENABLED: cockpit
success

You can see that, the cockpit service is already enabled by the installer.

Accessing Cockpit Web GUI Management Software:

Open URL https://rockylinux-01.centlinux.com:9090 in a web browser.

You may encounter some privacy warning.

This is because Cockpit software is using self-signed SSL/TLS certificates.

Ignore this warning and add a Security Exception.

Cockpit Login Page

Login as root user.

Cockpit Dashboard

You have successfully login to Cockpit Web GUI Management Software.

Conclusion:

In this article, you have learned how to install Cockpit on Rocky Linux 8 or other RPM based distros.

Scroll to Top