How to Enable Cockpit on CentOS 8

0
159

Cockpit is a web accessible interactive admin interface for Linux machines. In this guide, we are going to learn how to enable cockpit on CentOS 8 to enable you administer your CentOS 8 system administration tasks from the browser.

How to Enable Cockpit on CentOS 8

Installing Cockpit on CentOS 8

CentOS 8 comes with Cockpit pre-installed. However, you would simply execute the command below to install it.

dnf install cockpit

Running Cockpit on CentOS 8

Cockpit web service is managed by systemd. Hence, it can be started as follows;

systemctl start cockpit.socket

To enable it to run on system boot;

systemctl enable cockpit.socket

The start and enable commands above can be executed as one command by running;

systemctl enable --now cockpit.socket

To check the status of the Cockpit web service;

systemctl status cockpit.socket
● cockpit.socket - Cockpit Web Service Socket
   Loaded: loaded (/usr/lib/systemd/system/cockpit.socket; enabled; vendor preset: disabled)
   Active: active (listening) since Sun 2019-10-06 13:57:36 EDT; 1min 39s ago
     Docs: man:cockpit-ws(8)
   Listen: [::]:9090 (Stream)
    Tasks: 0 (limit: 11512)
   Memory: 392.0K
   CGroup: /system.slice/cockpit.socket

Oct 06 13:57:36 localhost.localdomain systemd[1]: Starting Cockpit Web Service Socket.
Oct 06 13:57:36 localhost.localdomain systemd[1]: Listening on Cockpit Web Service Socket.

Allow Cockpit on Firewall

Cockpit web service usually listens on TCP port 9090.

To allow remote access to Cockpit, open this port on firewalld.

firewall-cmd --get-active-zones
firewall-cmd --add-port=9090/tcp --zone=MY_ACTIVE_ZONE --permanent

Replace MY_ACTIVE_ZONE accordingly.

firewall-cmd --reload

Accessing CentOS 8 Cockpit from Browser

By default, Cockpit includes a self-signed SSL/TLS certificate and can be access via the browser using the address, https://CentOS-Server-IP:9090.

By default Cockpit is configured to allow logins using username and password of any local account on the system. If you are logging as non-root user with sudo rights, ensure that you check, Reuse my password for privileged tasks.

How to Enable Cockpit on CentOS 8

When logged in, the default dashboard looks like;

Running System Administrative Tasks from Cockpit

To run system administrative tasks from Cockpit, ensure you login as a user with privileged rights.

Take for example, you need to create user account, you can either launch the terminal and execute the user account creation commands or simply click on the Accounts menu on the left panel and Create New Account. (Be sure to check, Reuse my password for privileged tasks when logging in).

Cockpit on CentOS 8 user creation

Enter the new user details and click create to create it.

creating user on Cockpit CentOS 8

You can later view user details on the same accounts menu.

If you need to use the terminal for this task, simply launch terminal by clicking Terminal on the left panel.

Cockpit terminal CentOS 8

Well, as you can see, it is very easy to use Cockpit to administer your CentOS tasks. Explore the full capability of Cockpit.

Read more on Cockpit User Guide.

Related Tutorials

Install Webmin on CentOS 8

Install and Setup Chrome Remote Desktop on Ubuntu 18.04

How to Setup Guacamole Web-based Remote Desktop Access Tool on Ubuntu 18.04

Install and Configure VNC Server on CentOS 8

LEAVE A REPLY

Please enter your comment!
Please enter your name here