How to install Cockpit on Rocky Linux 9.2

To install Cockpit on Rocky Linux 9.2

Introduction:

Cockpit is a server management dashboard that provides real-time information on the state of your machine. In addition to CPU load, filesystem statistics, processes, and other data also give access to the system. When you're not signed in to the control panel, Cockpit doesn't use any server resources. The Cockpit service only begins when you go to the control panel and use it.

Installation Steps:

Step 1: Check the OS version by using the below command

[root@Linuxhelp ~]# cat /etc/os-release
NAME="Rocky Linux"
VERSION="9.2 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.2"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.2 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2032-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.2"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.2"

Step 2: Install Cockpit web console package by using the below command

[root@Linuxhelp ~]# dnf install cockpit
Rocky Linux 9 - BaseOS                                                                                                                                                        5.1 kB/s | 4.1 kB     00:00
Rocky Linux 9 - BaseOS                                                                                                                                                        1.7 MB/s | 1.9 MB     00:01
Rocky Linux 9 - AppStream                                                                                                                                                     5.0 kB/s | 4.5 kB     00:00
Rocky Linux 9 - AppStream                                                                                                                                                     4.3 MB/s | 7.1 MB     00:01
Rocky Linux 9 - Extras                                                                                                                                                        3.1 kB/s | 2.9 kB     00:00
Rocky Linux 9 - Extras                                                                                                                                                         12 kB/s |  11 kB     00:00
Package cockpit-286.1-1.el9.x86_64 is already installed.
Dependencies resolved.
==============================================================================================================================================================================================================
 Package                                         Architecture                                   Version                                                  Repository                                      Size
==============================================================================================================================================================================================================
Upgrading:
 cockpit                                         x86_64                                         286.2-1.el9_2                                            baseos                                          39 k

Transaction Summary
==============================================================================================================================================================================================================
Upgrade  1 Package

Total download size: 39 k
Is this ok [y/N]: y
Downloading Packages:
cockpit-286.2-1.el9_2.x86_64.rpm                                                                                                                                              118 kB/s |  39 kB     00:00
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                          42 kB/s |  39 kB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                      1/1
  Upgrading        : cockpit-286.2-1.el9_2.x86_64                                                                                                                                                         1/2
  Cleanup          : cockpit-286.1-1.el9.x86_64                                                                                                                                                           2/2
  Running scriptlet: cockpit-286.1-1.el9.x86_64                                                                                                                                                           2/2
  Verifying        : cockpit-286.2-1.el9_2.x86_64                                                                                                                                                         1/2
  Verifying        : cockpit-286.1-1.el9.x86_64                                                                                                                                                           2/2

Upgraded:
  cockpit-286.2-1.el9_2.x86_64

Complete!

Step 3: Start the Cockpit service by using the below command

[root@Linuxhelp ~]# systemctl start cockpit.service

Step 4: Now check the status of the Cockpit service by using the below command

[root@Linuxhelp ~]# systemctl status cockpit.service
○ cockpit.service - Cockpit Web Service
     Loaded: loaded (/usr/lib/systemd/system/cockpit.service; static)
     Active: inactive (dead) since Tue 2023-09-05 00:24:19 IST; 43s ago
   Duration: 1min 30.080s
TriggeredBy: ● cockpit.socket
       Docs: man:cockpit-ws(8)
    Process: 5613 ExecStartPre=/usr/libexec/cockpit-certificate-ensure --for-cockpit-tls (code=exited, status=0/SUCCESS)
    Process: 5633 ExecStart=/usr/libexec/cockpit-tls (code=exited, status=0/SUCCESS)
   Main PID: 5633 (code=exited, status=0/SUCCESS)
        CPU: 1.666s

Sep 05 00:22:48 Linuxhelp systemd[1]: Starting Cockpit Web Service...
Sep 05 00:22:49 Linuxhelp systemd[1]: Started Cockpit Web Service.
Sep 05 00:24:19 Linuxhelp systemd[1]: cockpit.service: Deactivated successfully.
Sep 05 00:24:19 Linuxhelp systemd[1]: cockpit.service: Consumed 1.666s CPU time.

Step 5: If you are running a firewalld on the system, you need to enable the cockpit port 9090 in the firewall by using the below command.

[root@linuxhelp ~]# firewall-cmd --add-service=cockpit --permanent
Warning: ALREADY_ENABLED: cockpit
success
[root@linuxhelp ~]# firewall-cmd --reload
Success

Step 6: Now open the Cockpit web console in your web browser by using the below URL’s:

https://192.168.6.130:9090/

Step 7: If you are using a self-signed certificate, you will get a warning on the browser, simply verify the certificate and accept the security exception to proceed further with the login as shown in the below image.

Step 8: In the web console login screen, enter your system user name and password as shown in the below image.

Step 9: After successful authentication, the Cockpit web console interface opens as shown in the below image.

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to Install Cockpit webconsole on Rocky linux 9.2. Your feedback is much welcome

FAQ
Q
Is Cockpit open source?
A
Cockpit is free to use and available under the GNU LGPL
Q
Is 9090 a TCP or UDP?
A
9090 is UDP Port
Q
How do I enable the Cockpit?
A
systemctl enable --now cockpit.socket
Q
How do I access the Cockpit in Linux?
A
To access Cockpit, point the web browser to your computer or server IP on port 9090 : https://Computer IP:9090
Q
What is Cockpit in Linux?
A
The cockpit is a web-based graphical interface for servers.