Cockpit Usage Guide: Super-Efficient Web Interface Management for CentOS Stream 9

CentOS tutorial - IT technology blog
CentOS tutorial - IT technology blog

Quick Start: Install Cockpit in Just 5 Minutes

New to Linux or just looking for an intuitive tool to manage your server? Cockpit is the ideal solution. It makes CentOS Stream 9 administration as simple as browsing the web. To get started right away, you just need to execute a few basic commands:

Step 1: Install Cockpit

On CentOS Stream 9, Cockpit is already available in the official package repository, making installation extremely quick. I personally love this convenience in RHEL-based distributions!


sudo dnf install cockpit -y

Step 2: Enable and Start the Service

After installation, you need to ensure the Cockpit service is enabled and starts automatically every time the server boots:


sudo systemctl enable --now cockpit.socket

The command --now will start it immediately, saving you a separate systemctl start step.

Step 3: Open Port on the Firewall

Cockpit uses port 9090. If your CentOS Stream 9 is running a firewall (which most do!), you need to open this port to allow external access:


sudo firewall-cmd --permanent --zone=public --add-service=cockpit
sudo firewall-cmd --reload

The cockpit service is pre-defined in firewalld, which is very convenient. You don’t need to remember the specific port number 9090. After reloading the firewall, the changes will take effect immediately.

Step 4: Access the Web Interface

Now, you can open a web browser and access the address:
https://<your_server_IP_address_or_hostname>:9090

You will see the login screen. Use your Linux server’s user account and password (with sudo privileges) to log in. That’s it, you now have a complete server administration interface at your fingertips!

Detailed Explanation: What is Cockpit and Why Should You Use It?

Cockpit is a web-based server administration interface developed by Red Hat. Its primary goal is to simplify the management and monitoring of remote Linux systems. This interface is designed to be intuitive, lightweight, and resource-efficient.

You might ask yourself, why do I need Cockpit when there’s already a powerful CLI? When my company still had a few servers running CentOS 7 and needed to migrate to AlmaLinux, constantly switching between CLI versions and remembering separate configurations for each server was a real challenge.

Cockpit significantly simplified that work for me. It provides an overview and direct manipulation capabilities, making it easy to manage CentOS Stream 9, AlmaLinux, Fedora, or even Ubuntu servers from a single interface.

Key Features of Cockpit

  • System Overview: View CPU, RAM, Disk I/O, Network traffic intuitively in real-time.
  • Service Management: Easily start, stop, enable/disable systemd services.
  • View Logs: Quickly access system logs (journald) without using commands.
  • Storage Management: Create, manage LVM, partitions, and check disk status.
  • Network Configuration: Conveniently set up IP addresses, DNS, Bond, Bridge.
  • Account Management: Add, delete users, change passwords intuitively.
  • Integrated Terminal: Access the terminal directly in your browser, very convenient for complex commands.

With Cockpit, you don’t need to be a CLI expert to perform basic and advanced administration tasks. This is especially useful for IT beginners or those who want to focus on development work without being distracted by system administration commands.

Advanced: Unleashing Cockpit’s Hidden Power

Cockpit doesn’t just stop at managing a single server. It also has many advanced features that help you manage multiple servers simultaneously and integrate with other modern technologies.

Multi-Server Management (Dashboard)

One of the features I particularly love about Cockpit is the ability to manage multiple servers from a single dashboard. This feature is incredibly useful when you have a server cluster or need to monitor multiple virtual machines:

  1. Log in to a server where Cockpit is installed.
  2. Select the Dashboard item in the left menu.
  3. Click (+) Add new host and enter the IP address or hostname of the server you want to add.

To add a server, the new server also needs Cockpit installed and port 9090 open. After adding, you can easily switch between servers for management, without needing to open multiple browser tabs or different SSH sessions.

Container Management (Podman)

CentOS Stream 9 (and the RHEL ecosystem) encourages the use of Podman instead of Docker. Cockpit has a built-in module that helps you manage Podman containers intuitively:

  • View a list of running, stopped, or newly created containers.
  • Easily view container logs.
  • Access the terminal inside the container directly from the interface.

You just need to install the cockpit-podman module:


sudo dnf install cockpit-podman -y

Then, refresh the Cockpit page, and you will immediately see the “Podman Containers” section appear.

Real-time Performance Monitoring

Cockpit’s “Overview” section provides very detailed performance monitoring charts for CPU, RAM, Disk I/O, and Network. I personally use it frequently to quickly check server status when there are signs of slowdowns. These charts update in real-time, helping you detect issues promptly.

Practical Tips from My Experience

1. Always Prioritize Security

  • Use HTTPS: Cockpit uses HTTPS by default. Ensure your SSL certificate is valid. Or at the very least, understand self-signed certificate warnings to avoid unnecessary security risks.
  • Strong Passwords: Always use complex and unique passwords for user accounts on the server.
  • Limit Access: If possible, only allow access to port 9090 from trusted IP addresses by configuring firewalld more specifically.

2. When to Use Cockpit, When to Use CLI?

Cockpit is excellent for tasks such as:

  • Quickly monitoring system health.
  • Basic service management.
  • Checking logs.
  • Performing simple network configuration changes.

However, for automation tasks, complex configurations, or when you need high precision and detailed control, the CLI remains the top choice. I often use Cockpit for a “quick health check” of the server, then switch to the CLI when more in-depth “surgery” is needed.

3. Integration with FreeIPA/SSO

If you work in a large enterprise environment that uses FreeIPA or other Single Sign-On (SSO) solutions, Cockpit can be easily integrated. This helps manage users and permissions more effectively, ensuring that only authorized personnel access the server.

4. Explore Extension Modules

The Cockpit community is quite active, providing many useful extension modules (add-ons). You can find modules for Nagios, 45Drives Ceph Installer, and many other features. Explore and install modules that fit your needs to optimize your administration experience.

Hopefully, with this guide, you can confidently start administering CentOS Stream 9 with Cockpit effectively. Wishing you success with your servers!

Share: