Monitoring the health of a Raspberry Pi server without a GUI is tricky. Running commands in the Terminal over SSH sounded cool, but I wasn't aware of the high system usage and overheating issues. So, I tried Cockpit, a web-based GUI for system health monitoring for Linux servers, to manage my Raspberry Pi and realized how it was sorely missing from the bouquet of my self-hosted apps.
Of course, I know the top commands, but it's not easy to troubleshoot system health issues with just that. I found that Cockpit was lightweight and made viewing system information, storage, and network activity less overwhelming. Here's an account of my experience after I tried Cockpit to manage my Raspberry Pi 4B server.
4 reasons Cockpit is my go-to tool for remotely managing my Raspberry Pi
This web UI is packed with all the options you'll need to manage your Raspberry Pi server
Getting Cockpit to install and run on Raspberry Pi
Setting up the foundation
For this guide, I installed Cockpit on my Raspberry Pi, which runs Pi OS Lite (64-bit). You can refer to the official documentation to adjust the syntax and run the command specific to the Linux distribution you use on your Pi. We'll also need to use the Backports repository, which contains newer software versions compatible with older operating systems.
-
Add the Debian backports repository to your Pi's system with the following command:
echo "deb http://deb.debian.org/debian ${VERSION_CODENAME}-backports main" | sudo tee /etc/apt/sources.list.d/backports.list -
Install the Cockpit Backports version with the below command:
sudo apt install -t ${VERSION_CODENAME}-backports cockpit
I knew my Pi's OS was based on Debian 12 Bookworm, so I added that version name to the above command. You can run the lsb_release -a command to find the version codename of your system.
After installing Cockpit on Raspberry Pi, you can access it from a browser tab using the hostname IP and 9090 port number - http://. For example, I access Cockpit using the below URL for my Raspberry Pi in a web browser:
http://192.168.1.2:9090
When the Cockpit interface loads, you need to use your Pi's username and password to access it.
Simplified view of the system health
Neatly laid out options
When the home screen of the Cockpit interface launched, I clicked on the lock icon in the upper-right corner to enable Administrator Access. That amps the web console with extra privileges to access system-level services, storage, and other options. The first time I clicked on the options on the left sidebar, it took a couple of seconds to load the interface, and it was swift after that. With a single click, I can scour through storage options to check the health and mount points of the SSDs hooked to the Pi.
The networking section showed a graphic view of the network usage, which also appears in text form under it, quite helpful in assessing the traffic activity on my home network. I struggle to remember particular commands and syntax, which usually differ per Linux distribution. However, I don't plan to entirely get rid of that habit. The Cockpit has a built-in Terminal, which lets me run the usual commands without leaving the browser tab. I visit the Software Updates section to check for new updates instead of running a command in the Terminal.
Extending usability with extra applications
Arming the web console
To my surprise, Cockpit's web interface is extendable, with a few extra features that are installable as Cockpit apps. For starters, there are eight official apps and a handful of third-party ones, like a file browser, a file manager for Samba or NFS sharing, Tailscale manager, and others. I got the Networking Manager and Storage apps with the installation. Both are very useful for quickly peeking into the network situation or managing the storage on the Raspberry Pi.
The Storage app delivers full details, including the storage device type, name, mount location, and even free and used space numbers. Besides, it has a built-in disk utility that lets me create a new partition and shrink or grow an existing one. However, I had to enable certain modules for Cockpit to easily access the partitions and stop throwing errors. I installed the Diagnostic Reports app to get a full-blown report of the Raspberry Pi system and review it later. Unfortunately, some of the Cockpit apps don't support Debian by default.
Troubleshooting and maintenance are faster
Spring cleaning the system
The Logs section is handy for learning about the borked apps and services. Using the Priority drop-down to filter the log messages, I look for errors and warnings that might be causing apps and services to malfunction. That's how I discovered the Zigbee2MQTT add-on for Home Assistant glitched and threw errors.
Whenever time allows, I dive into the Services option to find out about the unwanted services running in the background on the Raspberry Pi. After I select a specific service, I use the ellipses (kebab menu) to restart or stop it. But before that, I click "Show relationships" to understand how and where the service is wanted and conflicts in the system. Similarly, the Account section helped remove the leftover groups I created while trying out different dashboards and self-hosted apps I no longer use. Visually weeding out the unwanted services and groups helps me speed up the fine-tuning process.
I monitor all of my self-hosted services using this free tool on my Raspberry Pi
Most of us don't need all of Grafana's bells and whistles, so Uptime Kuma is close to perfect for monitoring our services
A powerful command center to manage a Raspberry Pi server
I often access the Cockpit remotely to check whether my Raspberry Pi is overheating or out of space. Running only the necessary commands in the web console's Terminal is also handy. Monitoring my Pi's system health is a breeze, and I can easily stop or remove the resource-consuming services or apps quickly. Apart from Raspberry Pi, I also added the web server I use to host my website after enabling HTTPS in Cockpit. My next project involves using Cockpit's system performance metrics and integrating them into Grafana using Redis and Valkey for detailed graphs.
