Operations 9 min read

Master Linux Server Management with Cockpit on CentOS 8 – A Complete Guide

Learn how to install, configure, and use Cockpit—a built‑in web‑based visual management tool in CentOS 8—to handle user accounts, firewalls, storage, monitoring, container management, and software updates, with step‑by‑step commands, repository tweaks, and practical screenshots.

macrozheng
macrozheng
macrozheng
Master Linux Server Management with Cockpit on CentOS 8 – A Complete Guide
I've been using CentOS 7 for a long time, recently tried CentOS 8 and discovered its built‑in visual management tool Cockpit, which supports many common command‑line operations via a sleek interface.

Cockpit Introduction

Cockpit is a web‑based visual management tool bundled with CentOS 8 that provides graphical interfaces for common command‑line tasks such as user management, firewall configuration, and server resource monitoring, aiming to be an easy‑to‑use Linux administration tool for everyone.

CentOS 8 Installation

To experience the latest Cockpit, you need to install CentOS 8. The installation process is similar to CentOS 7; the example uses version 8.5.2111. Refer to a VM installation guide and download the ISO from the official vault.

Install CentOS 8 (same steps as CentOS 7). Image download: https://vault.centos.org/8.5.2111/isos/x86_64/

When yum cannot download packages, switch to the Aliyun mirror by using the

Centos-vault-8.5.2111.repo

repository.

<code># Backup original BaseOS repo
mv /etc/yum.repos.d/CentOS-Linux-BaseOS.repo /etc/yum.repos.d/CentOS-Linux-BaseOS.repo.bak
# Download new repo configuration
sudo wget -O /etc/yum.repos.d/CentOS-Linux-BaseOS.repo http://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
</code>

Edit the repo files under

/etc/yum.repos.d

, copying the

appstream

section from

CentOS-Linux-BaseOS

into

CentOS-Linux-AppStream.repo

.

<code>[appstream]
name=CentOS-8.5.2111 - AppStream - mirrors.aliyun.com
baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/AppStream/$basearch/os/
        http://mirrors.aliyuncs.com/centos-vault/8.5.2111/AppStream/$basearch/os/
        http://mirrors.cloud.aliyuncs.com/centos-vault/8.5.2111/AppStream/$basearch/os/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
</code>

Clear the yum cache and rebuild it.

<code>sudo yum clean all
sudo yum makecache
</code>

Test by querying a package; the repository now works correctly.

Cockpit Installation and Startup

The installation and startup of Cockpit on CentOS 8 is straightforward.

CentOS 8 includes Cockpit by default; just enable and start the service.

<code># Enable Cockpit to start on boot and start it now
systemctl enable --now cockpit.socket
# Start Cockpit service
systemctl start cockpit
</code>

On CentOS 7, Cockpit must be installed manually and the service opened.

<code># Install Cockpit
yum install cockpit
# Open firewall for Cockpit
firewall-cmd --permanent --zone=public --add-service=cockpit
# Reload firewall
firewall-cmd --reload
</code>

After installation, access Cockpit via a browser at

http://<your-ip>:9090/

using any Linux user (e.g., root).

Cockpit Usage

With Cockpit, you can replace many command‑line tasks with a graphical interface.

Overview : View basic server information, CPU and memory usage, system details, and hardware configuration.

Usage : Detailed monitoring of CPU, memory, disk, and network—essentially a graphical

top

command.

Storage : Inspect file system details, manage volume groups, and mount NFS shares.

Network : Monitor firewall and network status; enable or disable services.

Firewall : View open ports and add services directly, replacing manual

firewalld

commands.

Podman Containers : Manage containers similarly to Docker, e.g., pull an Nginx image and run it on port 80.

Account : Manage Linux users through a UI, eliminating the need for

useradd

.

Software Updates : Receive and apply system updates via the Cockpit interface.

Applications : Install a limited set of server applications directly from Cockpit.

Terminal : Open an integrated terminal for command‑line operations when needed.

SELinux : Enable or disable SELinux through the UI.

Summary

As the official visual management tool bundled with CentOS 8, Cockpit covers many common server administration tasks, offering a sleek and user‑friendly interface. Users upgrading to CentOS 8 should give Cockpit a try.

References

Official documentation: https://cockpit-project.org/documentation.html

TutorialCentOSWeb UICockpitServer managementLinux administration
macrozheng
Written by

macrozheng

Dedicated to Java tech sharing and dissecting top open-source projects. Topics include Spring Boot, Spring Cloud, Docker, Kubernetes and more. Author’s GitHub project “mall” has 50K+ stars.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.