Cockpit is a free and open-source front-end server management tool that allows Linux users and system administrators to monitor and troubleshoot pesky issues on their systems. Cockpit is accessed through a web browser and its dashboard gives you a peek of your server's health alongside other system statistics such as network usage, disk space, and utilization, current users, system uptime, running processes and system logs. Additionally, you can run administrative tasks such as enabling and disabling the firewall, creating and deleting users, installing / updating / upgrading / uninstalling software packages and even rebooting or powering off the server.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related Open Source Software Installation queries on Linux Systems.
In this context, we shall look into how to install Cockpit on the CentOS system.
In a previous section, we mentioned the installation process of Cockpit on Ubuntu OS .
Process to Install Cockpit on CentOS 8 system
To install Cockpit on CentOS, follow the steps outlined below.
1. Install Cockpit
The cockpit is included in the CentOS default repositories. So in order to install Cockpit on CentOS, you only require to run the command below in your Terminal:
$ sudo yum install cockpit
Enter the sudo password, after which Cockpit should be installed on your system. During installation, if it asks for confirmation, type y and press Enter.
You don't have to manually start the Cockpit service as it automatically starts after installation. However, in case it is not started, you can manually start it as follows:
$ sudo systemctl start cockpit
To enable the service to automatically start at boot, use the command below:
$ sudo systemctl enable cockpit
To verify if the service is started and running, view the status of cockpit service as follows:
$ sudo systemctl status cockpit
The output of the command should verify that the Cockpit is active and running.
2. Configure Firewall
Cockpit's browser-based interface can be accessed on localhost port 9090. If you need to access the cockpit web interface from other systems, you will need to allow external connections to port 9090 through the firewall.
Use the command below to allow Cockpit’s web interface accessible from other systems:
$ sudo firewall-cmd --permanent --zone=public --add-service=cockpit
Then reload firewall:
$ sudo firewall-cmd --reload
This rule will allow other systems to access the Cockpit web interface.
3. Access Cockpit Web Interface
To access the Cockpit web interface, head to https://localhost:9090 in your web browser. To access the web interface from any other system, use https://ip-address:9090, where ip-address is the IP address of the Cockpit server.
After accessing the web interface, you will see a login page. You can log in to Cockpit using the username and password of any local account of your Cockpit server. Once you are logged in, you will see a Dashboard with only one server listed in it which is the Cockpit server itself.
4. Add Servers for Monitoring
To manage remote servers from Cockpit, you will first need to make sure they have:
- Cockpit installed and running. If the remote machine is CentOS, you can use the steps described above for installing Cockpit. If the remote machine is Ubuntu or Debian, follow this guide.
- SSH enabled (Visit how to enable SSH on Ubuntu and CentOS).
- SSH port allowed in the firewall.
Now to add remote serves for monitoring, click Add new host from the left panel in the Cockpit web interface. It will open a Add new host window. Here, enter the hostname/IP address and username of the remote system. Then click Add.
Next, you'll see a window with your host key fingerprint. Here you are required to verify the host key fingerprint. You can do so by running the command displayed on the screen on your remote system.
Compare the fingerprint with your host key fingerprint. If the fingerprint on the remote machine matches with fingerprint on Cockpit server machine, click Accept key and connect, otherwise click Cancel.
Once the host is added, you will see it listed in the let panel of Cockpit's web interface. Similarly, you can add multiple hosts in the Cockpit for monitoring.
How to Uninstall Cockpit from CentOS 8 machine ?
In case, you need to remove Cockpit from your system, you can do so using the command below in the Terminal:
$ sudo yum remove cockpit
[Need help in Installing Open Source Software on CentOS Linux System? We can help you. ]