How To Install Cockpit on CentOS 8 / RHEL 8

THIS DOCUMENT IS ALSO AVAILABLE FOR

Cockpit is a web-based administration tool for the system admin to manage and monitor the local system, as well as the remote Linux servers in your infrastructure.

The Cockpit console lets you perform a wide range of administration tasks, including:

  1. Manage remote machines in a single Cockpit console
  2. Manage Podman containers
  3. Modify Network interfaces
  4. Manage Virtual Machines
  5. Manage user accounts
  6. Web-based terminal
  7. View system performance in a graph.
  8. Collect system configuration and diagnostic information with the use of sosreport.

Here, we will see how to install Cockpit on CentOS 8 / RHEL 8 .

Install Cockpit

CentOS 8 / RHEL 8 includes the Cockpit installed by default during the OS installation except for the minimal installation.

Install the Cockpit package in case the package is not already installed.

dnf install -y cockpit

You can install add-on packages to manage other tasks using Cockpit.

Enable the Cockpit service.

systemctl enable --now cockpit.socket

Firewall

Add a firewall rule to allow Cockpit to manage the remote machines as well as to enable us to access the Cockpit dashboard from external machines.

firewall-cmd --permanent --add-service=cockpit

firewall-cmd --reload

Access Cockpit

The Cockpit console should now be accessible if you visit the below URL using the browser .

https://ip.add.re.ss:9090

Click proceed if you get a warning message for a self-signed certificate and proceed to access the Cockpit console.

Self-Signed Certificate Warning
Self-Signed Certificate Warning

Log in to Cockpit with your local system user account. In my case, it is root.

Login to Cockpit
Login to Cockpit
Optionally, click on Reuse my password for privileged tasks in case you are trying to log in as a regular user and have sudo privileges to perform administrative tasks.
Regular User Login
Regular User Login

Working With Cockpit

Once you have logged in into the Cockpit console, you will get the System page where you can see an overview of your system. Here, you can change the hostname, time, restart or shut down the system and view the system usage graphs.

Cockpit Dashboard
Cockpit Dashboard

You can view logs from the console to troubleshoot your system issues. You have an option to filter the logs based on duration and severity.

View System Logs with Cockpit
View System Logs with Cockpit

You can manage disks, partitions, and LVM by going to Storage (dnf install -y cockpit-storaged). Also, you can check disk read and write performance and storage logs.

Manage Storage with Cockpit
Manage Storage with Cockpit

Another important section is Networking. Here, you can change the system IP address, create network bonding, teaming, network bridge and add VLAN. In addition to that, you can manage the firewall and view the network graphs and logs.

Manage Networking with Cockpit
Manage Networking with Cockpit

You can manage Podman containers by going yo the Podman Containers (dnf install -y cockpit-podman) page. Here, you can run, stop, delete and commit containers.

Manage Podman Containers with Cockpit
Manage Podman Containers with Cockpit

Manage the Kernel virtual machines (dnf install -y cockpit-machines) by going to Virtual Machines.

Manage Virtual Machines with Cockpit
Manage Virtual Machines with Cockpit

You can create and manage the system users by going to Accounts.

User Management with Cockpit
User Management with Cockpit

You can see the details of system services by clicking on Services. Here, you can start, stop, restart, enable or disable the service by clicking on a particular service.

Manage System Service with Cockpit
Manage System Service with Cockpit

You have an option to generate a sosreport and share it with the support team by going to Diagnostic Reports using the Cockpit.

Generate System Diagnostic Report with Cockpit
Generate System Diagnostic Report with Cockpit

Manage kernel crash dump by going to Kernel Dump. You can also test kernel crash dump configuration.

Manage Kernel Crash Dump
Manage Kernel Crash Dump

You can seamlessly update the system packages using Software Updates.

System Updates with Cockpit
System Updates with Cockpit

You can also take the terminal of the server by clicking on the Terminal.

Web Terminal using Cockpit
Web Terminal using Cockpit

Manage Multiple Servers with Cockpit

To add a remote server with Cockpit, click on Dashboard (dnf install -y cockpit-dashboard && systemctl restart cockpit.socket). Then, click on the Plus sign icon to add it.

Add Remote Machines to Cockpit
Add Remote Machines to Cockpit
The remote machine you are trying to add should already have the Cockpit package installed, and the service is started.

Click connect when Cockpit reports Unknown Host Key.

Unknown Host Key
Unknown Host Key
If the user on the remote Cockpit machine is different from the currently logged in user, manually enter the username and password of the remote machine to connect.
Log in to Remote Machine
Log in to Remote Machine

You should now see the local and remote machine(s) in the Cockpit dashboard.

Remote Machine Connected with Cockpit
Remote Machine Connected with Cockpit

Overview of the remote system:

Detailed Overview of Remote Machine
Detailed Overview of Remote Machine

Conclusion

That’s All. I hope you have learned how to install Cockpit on CentOS 8 / RHEL 8 and use it for system administration activities.

Prev Post
Next Post
comments powered by Disqus