How to Install Cockpit on CentOS 8

Install Cockpit on CentOS 8

In this article, we will have explained the necessary steps to install and configure Cockpit on CentOS 8. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Cockpit is a free and open-source web-based server management software. It has a pretty web console that allows system administrators to easily perform tasks such as storage administration, network configuration, and many more. On the other hand, Cockpit gets along very well with after-server applications such as Ansible. This means that the integration with the server is practically complete. In addition, the application is quite well supported by its creators and is available for the largest Linux distributions.

Prerequisite:

  • Operating System with CentOS 8
  • Server IPv4 Address with Superuser Privileges (Root Access)
  • Gnome Terminal for Linux Desktop
  • PuTTy SSH client for Windows or macOS
  • Powershell for Windows 10/11
  • Familiar with DNF Commands

Install Cockpit on CentOS

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo dnf update

Step 2. Install Cockpit on CentOS 8.

We initiate the Cockpit installation with the following command:

sudo dnf install cockpit

Next, enable and start the cockpit.socket service to connect to the system through the web console and verify the service and running the cockpit process using the following commands:

systemctl start cockpit.socket
systemctl enable --now cockpit.socket
systemctl status cockpit.socket

Step 3. Setting up the firewall.

If you are running a firewalld on the system, you need to open the cockpit port 9090 in the firewall:

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

Step 4. Accessing CentOS 8 Cockpit from Browser.

By default, Cockpit includes a self-signed SSL/TLS certificate and can be accessed via the browser using the address, https://ip-address:9090. By default, Cockpit is configured to allow logins using the username and password of any local account on the system.

Congratulation, you have learned how to install and configure Cockpit on CentOS 8. If you have any questions, please leave a comment below.