How do I install and enable Cockpit that makes GNU/Linux and RHEL 8 for web management purpose? How do I see and manage my RHEL 8 based server in a web browser and perform system tasks with a mouse?
Introduction: The Cockpit is a free and open source web-based server management tool. By default, Cockpit comes preinstalled on an RHEL 8 server. But, it is not activated. A sysadmin must enable it. One can see the server in a web browser and perform system tasks with a GUI/mouse. It is easy to start containers, administer storage or users, configure networks, and inspect log files on RHEL 8. The Cockpit web interface is user-friendly for new to Linux users and seasoned sysadmins too.
The Cockpit web interface is user-friendly for new to Linux users and seasoned sysadmins too. Of course, you can use ssh to manage your server or use the web interface at any time. There is even an embedded terminal in Cockpit web GUI.
How to install Cockpit web console on RHEL 8
Cockpit is included in the Red Hat Enterprise Linux Extras repository in versions 7.1 and later. It is installed by default on RHEL 8. Here is how to installed it on RHEL 8 using the yum command$ sudo yum install cockpit
Open the firewall ports:$ sudo firewall-cmd --add-service=cockpit
$ sudo firewall-cmd --add-service=cockpit --permanent
Sample outputs:
Created symlink /etc/systemd/system/sockets.target.wants/cockpit.socket ? /usr/lib/systemd/system/cockpit.socket.
How to activate Cockpit web console on RHEL 8
Once installed, enable and activate Cockpit web console on RHEL 8, by running the following systemctl command:$ sudo systemctl enable --now cockpit.socket
By default, Cockpit accepts connections on port TCP port # 9090. Use the ss command to view open port:$ sudo ss -tulpn | grep :9090
Sample outputs:
tcp LISTEN 0 128 *:9090 *:* users:(("cockpit-ws",pid=4278,fd=3),("systemd",pid=1,fd=27))
How to use Cockpit web console on RHEL 8
Now that you have Cockpit installed and enabled on RHEL 8, it is time to start using it. All you have to do is fire a web browser and type the following url:https://ip-address-of-rhel8-server:9090
OR use FQDN:https://server1.cyberciti.biz:9090
When prompted use your RHEL 8 system user account and password to log into the system:
Press Login button and voila:
Let us take a quick tour of rest of the Cockpit web UI that one can use manage RHEL 8 box (click to enlarge image):
Conclusion
The Cockpit software is entirely free to use and available under the GNU LGPL. It is perfect for managing the server based upon RHEL 8. However, for a large number of servers or VMs you better use something like Ansible. For more info see Cockpit project home page here.