How to Manage Your Linux System with Cockpit

Cockpit Feature

There are many ways to manage the services and resources running on both your system and other systems on your network. They range from various vendor applications to the old standby SSH. However, on certain Linux distributions, there is an excellent web-based tool called Cockpit. Cockpit is an extensible and easy-to-use web application designed to help you manage your Red Hat-based Linux systems, including RHEL, CentOS, and Fedora. This guide will show you how to manage your Linux system with Cockpit.

Note: we are using Fedora for this tutorial, but the instructions will be similar for other distros.

Installing Cockpit

First, make sure your system is up to date. Do that by opening a terminal and typing:

sudo dnf update -y

When that command completes, enter the command to install Cockpit via the DNF package manager.

sudo dnf install cockpit -y

Cockpit is also part of the “Headless Management” software group, so install it from there along with several other tools that to help manage a Fedora workstation or server across the network.

sudo dnf groupinstall "Headless Management" -y

In order to access your Cockpit web console, make sure you allow Cockpit through the system firewall and start the service. To allow Cockpit through the firewall, enter the following command:

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

You will get a message that says success. Next, start and enable the systemd service. To do that, enter the following command:

sudo systemctl enable cockpit.socket
sudo systemctl start cockpit.socket

You will be able to open up your web browser and type in localhost:9090 and will see the Cockpit Web Console come up on your screen.

The Cockpit Web Console

From here, log in with your typical username and password, and you’ll be greeted with a friendly overview. You can see various information, including your hostname for network communications, system information, resource usage, and various navigation elements. Use this information to look at logs, storage, networking information, and more.

Cockpit Overview

Clicking on Logs brings you to an overview of the various system logs. This can be useful if you’re having issues with a particular program or piece of hardware on a system. For example, if you’re using Fedora on a laptop and have trouble with your Wi-Fi, you can check the Logs page on Cockpit to see if there are any kernel logs from iwlwifi and attempt to correct them.

Cockpit Logs

If you click on Storage, it brings up a page where you can easily monitor the storage devices attached to your system, including both SATA drives and CD/DVD drives. The Storage page of Cockpit is a useful blend of drive activity, partition and device lists, storage logs, and NFS mount management, something difficult to find in any one single tool. Rather than having multiple terminal tabs running to see all of this information, you can just pull up this page in Cockpit.

Cockpit Storage

The next item is Networking, where you can easily manage your network interfaces and firewall, including turning on or off networking interfaces and configuring networking bonds or VLANs. This can be incredibly useful for managing networking on a server or workstation with multiple NICs and server roles, allowing you to quickly and easily lay out all of your NICs in one quickly-accessible spot.

Cockpit Networking

The Accounts tab is easily the simplest. You can manage the accounts on your system. This can be useful if you have a server that multiple administrators or users access and you need to manage their permissions.

Cockpit Accounts

Services is one of the more complex tabs in Cockpit. You can manage all of your system’s services from here. If a service needs to be started in order for something on your server to work, i.e. libvirtd, sshd, or cups, this is where you’d head to start that service. There are other sections on the Services tab, but those are more likely to be edge-use cases that are more advanced than this guide’s scope.

Cockpit Service

Go to Applications to add or remove additional functionality in Cockpit. You can add modules for managing SELinux, QEMU/KVM virtual machines, and even podman containers. This can make it very easy for you to get started with these tools and avoid some of the headache that comes along with learning complex tools for the first time.

Cockpit Applications

Software Updates is a very useful page for managing security and software updates. You can choose to only install security updates, install all updates, and even configure automatic updates. This can be a huge boon for people managing Fedora servers that require somewhat frequent updates. It can also be helpful for people who are choosing to only apply security fixes and not change anything about their other software.

Cockpit Software Updates

Terminal is the final tab under the Host section, and it serves the purpose of giving you access to more granular control over your system. For example, if you work with a piece of software that doesn’t have a Cockpit module, you can still manage it from a friendly web interface without having to jump into an SSH client or terminal on your local system.

Cockpit Terminal

Finally, you have the Dashboard. From the Dashboard you can easily see usage across all of the major resources: CPU, Memory, Network I/O, and Disk I/O. You can also add other servers to this dashboard. Uou can quickly glance at a dashboard to see if one server has high CPU usage compared to the others. It’s incredibly useful for virtual servers as well.

Cockpit Dashboard

Cockpit is a simple and user-friendly way to manage your Linux systems. Multiple Linux servers, physical or virtual, can easily be configured through Cockpit, and multiple different modules can be added to increase the functionality. Now that you’ve learned about Cockpit, make sure to check out our other posts on remote system management to learn how to access your Mac remotely and how to set up remote access on a host with a dynamic IP address.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

John Perkins

John is a young technical professional with a passion for educating users on the best ways to use their technology. He holds technical certifications covering topics ranging from computer hardware to cybersecurity to Linux system administration.