How to enable Cockpit on CentOS 8

CentOS 8 includes the powerful Cockpit admin tool. Learn how to enable and access it for easy OS management.

How to enable Cockpit on CentOS 8

Cockpit is a powerful web-based GUI that allows admins to manage many aspects of their CentOS- or RHEL-based servers. Cockpit allows you to get a quick look at the system performance, view logs, manage storage, enable/disable firewall, configure various aspects of networking, create new user accounts, stop and start services, view SSH sessions, view diagnostic reports and kernel dumps, manage SELinux, update software, and access a terminal on the server. In other words, it's exactly what you need to manage your CentOS server.

With CentOS 7, you had to install Cockpit after the installation of the operating system. It wasn't a terribly challenging process, but it was yet another step you'd have to take to get your CentOS machine to a state where you didn't have to rely on secure shell and the command line to administer the platform--although every admin should be capable of doing just that.

SEE: Choosing your Windows 7 exit strategy: Four options (TechRepublic Premium)

With the recent release of CentOS 8, Cockpit is installed by default. However, there is one caveat. Although Cockpit is installed out of the box, it is not enabled. So in order to access this fantastic tool, you must first enable it.

I'm going to show you how to enable Cockpit and then how to access it.

What you'll need

The only things you'll need are a running instance of CentOS 8 and an account on the CentOS 8 installation which has sudo privileges.

How to enable Cockpit

In order to enable Cockpit, log onto your CentOS 8 server. From the terminal prompt, issue the command:

sudo systemctl enable --now cockpit.socket

You will be prompted for your sudo password. Once you've typed that password, hit Enter and Cockpit is enabled and ready to work.

How to access Cockpit

With Cockpit enabled, open a web browser on a machine that has access to the CentOS 8 server and point it to https://SERVER_IP:9090. You will then be prompted for admin credentials (Figure A).

Figure A


Logging into Cockpit.

I highly recommend you not log in as the root user. Instead, make sure you log in with a different user account (one with admin privileges). If you've not created a user with admin privileges, go ahead and log in to Cockpit with the root account and then immediately go to Accounts and create a new user. The one caveat to creating a new user account with Cockpit is that you first must create the new account and then, once it's created, edit the account to give the user admin privileges (Figure B).

Figure B


Granting admin privileges to an account.

Click the checkbox for Server Administrator. When that user logs out and logs back in, they will then be a member of the wheel group (which is the administrator group in CentOS). That user will now enjoy all the privileges of being an administrator. Use that login (instead of root) to work with Cockpit.

And that's all there is to enabling and accessing the Cockpit web-based GUI on CentOS 8. Enjoy having a user-friendly admin tool at your fingertips.

Also see


Image: Jack Wallen