How to manage Linux systems through web browser (cockpit for Linux): CentOS 7, CentOS 8, RHEL 7, RHEL 8, Fedora, Ubuntu and Debian systems.




    Cockpit is a web accessible interactive admin interface for Linux machines. Cockpit can usually be accessed on port 9090 of the machine it's installed on.

    The cockpit-ws web service listens on port 9090 and is started on demand by systemd. The Cockpit web service authenticates the user, loads Cockpit into the browser, and starts cockpit-bridge in a Linux user session. The cockpit-bridge provides Cockpit in the web browser with access to the system APIs. It does this over its standard in and standard out.

    Cockpit can be installed in the following Operating systems. Please not that this list is where I installed and tested, that does not mean that it will not work on other Operating Systems.

  • RHEL 7 & RHEL 8
  • CentOS 7 & CentOS 8
  • Ubuntu
  • Debian


    Cockpit is a very helpful tool which can be used to access the Linux servers through a web browser and do all kind of administration tasks. Some of the main features of Cockpit are:

  • Web GUI administration of local and remote servers.
  • Manage multiple servers in single window.
  • Access to remote terminal through web browser.
  • Management of Docker containers and Kubernetes.
  • Dashboard of local and remote servers to monitor the performance and utilization.
  • Gather diagnostics reports.


    Though I am describing the installation procedure on Debian and Ubuntu in this document, the main focus is on installing and configuring it on CentOS and Linux systems.

Below packages are required for the configuration of Cockpit in CentOS and RHEL systems.

Cockpit              << -- Package to rum cockpit as a service.        
cockpit-storaged            << -- Package required to enable storage utilities in the browser.        
cockpit-ws                          << -- Manage web server 
cockpit-dashboard         << -- Package required to enable dashboard of local and remote systems.        
cockpit-docker                << -- Manage docker container
cockpit-kubernetes       << -- Manage Kubernetes
cockpit-packagekit       << -- manage packages

    Cockpit uses the port number “9090” for web browser access. Please make sure to enable the necessary firewall rules to access the cockpit web browser.

Installation procedure:

CentOS 7 & Cent OS 8 Systems

Install the basic package of cockpit.
# yum install cockpit -y

Enable the service for system start up and start the service.
# systemctl enable cockpit.socket
# systemctl start cockpit.socket

Enable the firewall rules and reload the service.
# firewall-cmd --add-service=cockpit --permanent
# firewall-cmd --reload

This procedure would work of Fedora systems as well.


RHEL 7 & RHEL 8 systems

In RHEL systems before we start the installation enable the necessary repository of cockpit.
For RHEL 7:
# subscription-manager repos --enable rhel-7-server-extras-rpms
 For RHEL 8:
# subscription-manager repos --enable rhel-8-server-extras-rpms

Install the basic package of cockpit.
# yum install cockpit -y

Enable the service for system start up and start the service.
# systemctl enable cockpit.socket
# systemctl start cockpit.socket

Enable the firewall rules and reload the service.
# firewall-cmd --add-service=cockpit --permanent
# firewall-cmd --reload

Ubuntu Systems
Enable the repository and update the packages before installation.
# add-apt-repository ppa:cockpit-project/cockpit
# apt-get update

Install the basic package of cockpit.
# apt-get install cockpit

Enable the service for system start up and start the service.
# systemctl enable --now cockpit.socket

Debian Systems
Need to use an external repository for Debian systems. Configure the repository by editing the file /etc/apt/sources.list and adding the below entry.
deb https://fedorapeople.org/groups/cockpit/debian unstable main
Enable the keys and update the packages by below commands.
# apt-key adv --keyserver sks-keyservers.net --recv-keys F1BAA57C
# apt-get update

Install the software and start the service.
# apt-get install cockpit
# systemctl enable --now cockpit.socket

How to access the cockpit.
As I mentioned above, cockpit uses the port 9090 by default. The cockpit can be accessed through web browser by using the below URL.
http://<IP Address or FQDN of your server>:9090

You will get a web page for login like below. The login credentials are the same you use for the server.

Once you logged in you will see the details like below in the system tab. You will see that the hardware type of the system, host name and system profile as highlighted below. You will get the over all picture of the resource utilization of CPU, Memory, Disk IO and network interfaces from the system page itself.

I have provided the screenshot of  some of the important fields below.
1.        Log watch
The below screenshot shows the current logs on the system. From the above drop-down boxes you can select the log periods and the type of logs to watch.

2.        Disk configuration
From this page you will get to know the details of file systems and their utilization, RAID devices configured, Volume groups, VDO devices, iSCSI devices and their performance etc. This page will help you to make necessary modification to your storage disks as well. For example, file system mount & unmount, lv, vg, partition creations, deletions, extensions etc.

3.        Network configuration
All network configurations can be viewed and modified here.

4.        Terminal
You can access the terminal of the system here.


Configuring remote systems in the dashboard.

So far, we saw the details and how to configure the devices locally. Now we are going to see the same set of details in the remote server.

Minimum requirements are:
1.        Cockpit and its components to be installed in remote system, cockpit service to be up and running and the port 9090 should be enabled for remote access.
2.        The package “cockpit-dashboard” to be installed in the system where the dash board to be enabled, usually where the remote systems are connected for remote administration.
Here in this demo, we have already installed the cockpit packages and its components in the remote system which I am going to connect. My remote system is “labhst1”.  We need to install the package “cockpit-dashboard” in the local system so that I can see another tab called “Dashboard” in the console as below.

# yum install cockpit-dashboard -y



Go to dashboard and click on the below + button to add new hosts. You can add the hosts by either keys or giving login credentials.

Here you can see that the new system added to the dashboard and you can select the remote servers from the drop-down as below.

The individual system details can be seen, and the system can be administrated through web browser as below.


I hope these documents helped you to some extend at least. Thanks for vising this page. You may contact us through email or giving a comment below.

Comments

Popular posts from this blog

AIX Firefox Installation

AIX Commands

How to increase swap size on CentOS 8 / RHEL 8

How to configure NTP in RHEL8 or CentOS 8 by chronyd.

System Administration

How to find big files in Linux, Unix, AIX

Remote X11 forwarding for AIX in command line.

How to enable VNC server (get GUI remotely) in CentOS 7, RHEL 7, CentOS 8 and RHEL 8 servers.

How to change Time Zone in CentOS 8, RHEL 8 and Ubuntu systems