The GUI Way of Using Linux (How To Use Cockpit on CentOS)
Tags: linux, webdev, beginners, productivity
Published: 2024-06-24 14:40:52

Have you every thought of executing Linux operations without the command line? Maybe not. But, now there’s a way to do that. You can use the Cockpit package for this purpose, which is extremely helpful for system administrators and server monitoring and maintenance teams. 

You can get the info about [cockpit ](https://cockpit-project.org) on the official website. But, the most convenient way to configure it is here in this blog. So, without wasting any second, let’s start with the practical. 

## The Cockpit Configuration Procedure 
We are going to perform this practical on CentOS operating system, a distribution of the Linux, developed  by RedHat enterprises. In numerous enterprise networks, it gets utilized as the primary server OS. So, it’s going to be beneficial for sure. 

Additionally, the entire procedure is divided into three phases. The first phase deals with download and installation of the cockpit package. Further, the phase two and three deals with the configuration and accessing the GUI-based Linux interface. 

So, let’s get started. 

### Phase 1: Cockpit Download and Installation 
Before, we dive into the practical, ensure to look at the snippets simultaneously for better understanding. 

We are going to configure cockpit as a root server. So, we have ensured that, system is accessed as root by using the command `whoami`. 


![whoami](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/61gt45gafyrm5kpt4qtr.png)

There can be a possibility that cockpit service package is already installed on your CentOS system. To find it out, use the command `rpm -qa | grep cockpit`. If the package would be available, you’ll see it in the list. 

In our case, it’s not available. 


![Checking package availability](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oni8u566a9vkn5jnppq8.png)

To install the cockpit package, use the command: `yum install cockpit -y`

The command will start the download and installation of the cockpit package on your CentOS operating system. 

![Installing cockpit](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oa9tw6rcg1wtm9hvwfxh.png)

After the successful installation, you will see a output as below.


![Installed](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i5cypzblo4jaxz3r7u3w.png)

Now, again check the cockpit package availability to verify its installation 

Run the command: `rpm -qa | grep cockpit` 


![Installation Verification](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aa2tnz9wgmx3a48q8ufa.png)

Here, the first phase ends. Now, move to the second one. 

### Phase 2: Enabling the Cockpit Service 
You have to use the classic method to enable the cockpit service, which is using the `systemctl`. 

Firstly, check the status of the services through command: `systemctl status cockpit` 

As you can see, currently the service is inactive.

![Cockpit state](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wxz0q4nceqp6cyk8n9he.png)

To make the service active, run command: `systemctl start cockpit`

However, if you want this service to run automatically with every boot, use the command: `systemctl enable cockpit` 


![Cockpit enable](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wn3qktwemd7afxfha89a.png)

After starting the service, check the status: `systemctl status cockpit`

As you can see, this time the service is running on our Linux machine. 

![Cockpit running](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yezhnbcal94mu1u3t2dz.png)

Here, our second phase ends. Move to the third one now. 

### Phase 3: Accessing the Linux System (GUI-based) 
Before you access the GUI-based interface, you should know about the URL for accessing Linux machine through cockpit.
 
URL: `http:// IP of your machine:9090` 

So, to fulfil the demand of the URL, run the `ifconfig` command to view your IP address. In our case, it’s `192.168.1.6`.

![IP](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ub6mwstscrrl3ax5dkh2.png)

Now, go to your web browser and use the URL, just like the snippet below. Enter the URL and hit enter. 


![Browser](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wi0m01xjztqkv02hhp3b.png)

Once you hit enter, a warning can be showed to you. You have to accept the risk and move forward to view the following login interface. 

However, if even after accepting the risk, you didn’t view the interface, go to Linux machine and disable the firewall using command: `systemctl disable firewalld`

(Note: Do not disable firewall in production environment)

Following it, again enter the URL and this time you’ll absolutely see the interface. Now, put your username and password of the Linux machine and hit the Log in button.  


![Login Interface](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w8i41pq9gi6poywbvuq4.png)

As a result, you will see the cockpit interface or the GUI-interface of your Linux machine. Now, you can execute all core operations without commands with utmost convenience. 


![Final Interface](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/piqx8qtuxehyjxbf8p7x.png)

Here, the third phase ends and also the practical procedure. Explore the interface and have fun with Linux GUI. 
## Concluding Up 
Nothing much to write here, as you already know how to use cockpit. For any further query or question, you can write a comment and expect me to get back to you within a week. Also, you can suggest topics and I would try to provide you the desired content on them. 

Keep supporting.