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.
Enabling Cockpit on CentOS 8
Install 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
.
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).
Enter the new user details and click create to create it.
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.
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 and Setup Chrome Remote Desktop on Ubuntu 18.04
How to Setup Guacamole Web-based Remote Desktop Access Tool on Ubuntu 18.04