How to configure Cockpit in RHEL 8

Learn how to install, configure and use cockpit web console in RHEL 8.

Install, configure and use Cockpit in RHEL 8

What is cockpit web console?

The cockpit is an open-source project aims at Red Hat Enterprise Linux web console using which system can be administered. Introduced in RHEL 7, Cockpit provides a user and device friendly web console to manage your systems. Being a web console, it can be accessed over mobile devices as well. Obviously CLI (Command Line Interface) is the wizard wand in sysadmin’s hand but sometimes small and quick changes can be done through this console. Cockpit is integrated systemd. Let’s see how to install the cockpit on RHEL.

How to install Cockpit web console in RHEL 8?

The cockpit is offered with a package of the same name. Install package cockpit, using yum to install the Cockpit web console in RHEL 8. If YUM configuration is not in place on your system, you can always mount RHEL 8 BETA ISO and configure yum with this ISO as a repo. Below are commands for it –

[root@kerneltalks ~]# cat /etc/yum.repos.d/dvdiso.repo
[dvdiso]
name=RedHat DVD ISO
baseurl=file:///mnt/dvd/BaseOS/
enabled=1
gpgcheck=1
gpgkey=file:///mnt/dvd/BaseOS/RPM-GPG-KEY-redhat-release
[root@kerneltalks BaseOS]# yum repolist
RedHat DVD ISO                                                                                                                          1.0 MB/s | 2.2 MB     00:02
Last metadata expiration check: 0:00:01 ago on Wed 28 Nov 2018 12:30:43 PM EST.
repo id                                                                      repo name                                                                            status
dvdiso                                                                       RedHat DVD ISO                                                                       1,688

Now install package cockpit using yum –

[root@kerneltalks ~]# yum --nogpg install cockpit
Last metadata expiration check: 0:01:21 ago on Wed 28 Nov 2018 12:30:43 PM EST.
Dependencies resolved.
========================================================================================================================================================================
 Package                                               Arch                            Version                                    Repository                       Size
========================================================================================================================================================================
Installing:
 cockpit                                               x86_64                          180-1.el8                                  dvdiso                           66 k
Installing dependencies:
 cockpit-bridge                                        x86_64                          180-1.el8                                  dvdiso                          553 k
 cockpit-system                                        noarch                          180-1.el8                                  dvdiso                          1.6 M
 cockpit-ws                                            x86_64                          180-1.el8                                  dvdiso                          820 k
 glib-networking                                       x86_64                          2.56.1-1.el8                               dvdiso                          155 k
 gsettings-desktop-schemas                             x86_64                          3.28.1-1.el8                               dvdiso                          619 k
 libmodman                                             x86_64                          2.0.1-17.el8                               dvdiso                           36 k
 libproxy                                              x86_64                          0.4.15-5.2.el8                             dvdiso                           74 k
Installing weak dependencies:
 redhat-logos                                          x86_64                          80.5-1.el8                                 dvdiso                          975 k
 subscription-manager-cockpit                          noarch                          1.23.8-1.el8                               dvdiso                          952 k

Transaction Summary
========================================================================================================================================================================
Install  10 Packages

Total size: 5.7 M
Installed size: 13 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                1/1
Installed: redhat-logos-80.5-1.el8.x86_64
  Installing       : redhat-logos-80.5-1.el8.x86_64                                                                                                                1/10
  Running scriptlet: redhat-logos-80.5-1.el8.x86_64                                                                                                                1/10
Installed: redhat-logos-80.5-1.el8.x86_64
Installed: libmodman-2.0.1-17.el8.x86_64
  Installing       : libmodman-2.0.1-17.el8.x86_64                                                                                                                 2/10
  Running scriptlet: libmodman-2.0.1-17.el8.x86_64                                                                                                                 2/10
Installed: libmodman-2.0.1-17.el8.x86_64
Installed: libproxy-0.4.15-5.2.el8.x86_64
  Installing       : libproxy-0.4.15-5.2.el8.x86_64                                                                                                                3/10
  Running scriptlet: libproxy-0.4.15-5.2.el8.x86_64                                                                                                                3/10
Installed: libproxy-0.4.15-5.2.el8.x86_64
Installed: gsettings-desktop-schemas-3.28.1-1.el8.x86_64
  Installing       : gsettings-desktop-schemas-3.28.1-1.el8.x86_64                                                                                                 4/10
Installed: gsettings-desktop-schemas-3.28.1-1.el8.x86_64
Installed: glib-networking-2.56.1-1.el8.x86_64
  Installing       : glib-networking-2.56.1-1.el8.x86_64                                                                                                           5/10
Installed: glib-networking-2.56.1-1.el8.x86_64
Installed: cockpit-bridge-180-1.el8.x86_64
  Installing       : cockpit-bridge-180-1.el8.x86_64                                                                                                               6/10
Installed: cockpit-bridge-180-1.el8.x86_64
Installed: cockpit-system-180-1.el8.noarch
  Installing       : cockpit-system-180-1.el8.noarch                                                                                                               7/10
Installed: cockpit-system-180-1.el8.noarch
Installed: subscription-manager-cockpit-1.23.8-1.el8.noarch
  Installing       : subscription-manager-cockpit-1.23.8-1.el8.noarch                                                                                              8/10
Installed: subscription-manager-cockpit-1.23.8-1.el8.noarch
Installed: cockpit-ws-180-1.el8.x86_64
  Running scriptlet: cockpit-ws-180-1.el8.x86_64                                                                                                                   9/10
  Installing       : cockpit-ws-180-1.el8.x86_64                                                                                                                   9/10
  Running scriptlet: cockpit-ws-180-1.el8.x86_64                                                                                                                   9/10
Installed: cockpit-ws-180-1.el8.x86_64
Installed: cockpit-180-1.el8.x86_64
  Installing       : cockpit-180-1.el8.x86_64                                                                                                                     10/10
Installed: cockpit-180-1.el8.x86_64
  Running scriptlet: redhat-logos-80.5-1.el8.x86_64                                                                                                               10/10
  Running scriptlet: cockpit-180-1.el8.x86_64                                                                                                                     10/10
  Verifying        : cockpit-180-1.el8.x86_64                                                                                                                      1/10
  Verifying        : cockpit-bridge-180-1.el8.x86_64                                                                                                               2/10
  Verifying        : cockpit-system-180-1.el8.noarch                                                                                                               3/10
  Verifying        : cockpit-ws-180-1.el8.x86_64                                                                                                                   4/10
  Verifying        : glib-networking-2.56.1-1.el8.x86_64                                                                                                           5/10
  Verifying        : gsettings-desktop-schemas-3.28.1-1.el8.x86_64                                                                                                 6/10
  Verifying        : libmodman-2.0.1-17.el8.x86_64                                                                                                                 7/10
  Verifying        : libproxy-0.4.15-5.2.el8.x86_64                                                                                                                8/10
  Verifying        : redhat-logos-80.5-1.el8.x86_64                                                                                                                9/10
  Verifying        : subscription-manager-cockpit-1.23.8-1.el8.noarch                                                                                             10/10

Installed:
  cockpit-180-1.el8.x86_64          redhat-logos-80.5-1.el8.x86_64   subscription-manager-cockpit-1.23.8-1.el8.noarch   cockpit-bridge-180-1.el8.x86_64
  cockpit-system-180-1.el8.noarch   cockpit-ws-180-1.el8.x86_64      glib-networking-2.56.1-1.el8.x86_64                gsettings-desktop-schemas-3.28.1-1.el8.x86_64
  libmodman-2.0.1-17.el8.x86_64     libproxy-0.4.15-5.2.el8.x86_64

Complete!

Now, make sure you have open firewall ports for Cockpit. Mostly it’s enabled by default during installation but its always good to verify.

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

Next step is to enable and start Cockpit using sysctl command so it will load on every boot.

[root@kerneltalks ~]# systemctl enable cockpit.socket
Created symlink /etc/systemd/system/sockets.target.wants/cockpit.socket → /usr/lib/systemd/system/cockpit.socket.

[root@kerneltalks ~]# systemctl start cockpit.socket
[root@kerneltalks ~]# systemctl status cockpit.socket
● cockpit.socket - Cockpit Web Service Socket
   Loaded: loaded (/usr/lib/systemd/system/cockpit.socket; enabled; vendor preset: disabled)
   Active: active (listening) since Wed 2018-11-28 12:38:52 EST; 1s ago
     Docs: man:cockpit-ws(8)
   Listen: [::]:9090 (Stream)
  Process: 9823 ExecStartPost=/bin/ln -snf active.motd /run/cockpit/motd (code=exited, status=0/SUCCESS)
  Process: 9816 ExecStartPost=/usr/share/cockpit/motd/update-motd  localhost (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 11516)
   Memory: 392.0K
   CGroup: /system.slice/cockpit.socket

Nov 28 12:38:52 kerneltalks.com systemd[1]: Starting Cockpit Web Service Socket.
Nov 28 12:38:52 kerneltalks.com systemd[1]: Listening on Cockpit Web Service Socket.

This will enable and activate the Cockpit service on RHEL. Since service is running now, Cockpit will listen to port 9090 by default. Check if the Cockpit service is listening on a port and open up your browser to access the web console.

How to connect Cockpit web console on RHEL 8

As we already mentioned, by default Cockpit listens on port 9090. All you have to do is open up a browser and go to https://ip_or_hostname:9090 URL and you will be connected to the Cockpit web console. So, in our case the Cockpit URL is https://192.168.56.101:9090. You will be greeted with the login screen as below –

Cockpit web console in RHEL 8

Use root account to login and you will be presented with the home screen of Cockpit web administration console like below –

System administration using Cockpit web console

That’s it. You have web console in front of you. You can see utilization metrics in real time on home screen. Left hand side menu gives you ways to manage your system. Explore!

One thought on “How to configure Cockpit in RHEL 8

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.