
Last year, I wrote an article about using Cockpit to manage my Linux servers. It is a web-based tool that provides a clean and powerful interface for managing multiple servers and their associated services and applications. It also simplifies daily management tasks.
In this article, I will introduce how to install the Cockpit web console for Linux servers on the standard operating system Raspberry Pi OS provided by the Raspberry Pi Foundation. I will also briefly introduce its features.
Installing Cockpit on Raspberry Pi OS
Log in to your Raspberry Pi system via SSH using an account with sudo
privileges. If you haven’t created an account:
$ ssh pibox
alan@pibox's password:
Linux pibox.someplace.org 5.10.17-v7+ #1403 SMP Mon Feb 22 11:29:51 GMT 2021 armv7l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue May 4 09:55:57 2021 from 172.1.4.5
alan@pibox:~ $
Installing the Cockpit web console on Raspberry Pi OS is as simple as on a Linux server:
$ sudo apt install cockpit
Cockpit requires only 60.4 KB of disk space. Including its few package dependencies, the total usage is 115MB.
The installation process will handle the setup and starting of the service. You can verify the status using the systemctl
command:
$ systemctl status cockpit.socket
● cockpit.socket - Cockpit Web Service Socket
Loaded: loaded (/lib/systemd/system/cockpit.socket; enabled; vendor preset: enabled)
Active: active (listening) since Tue 2021-05-04 10:24:43 EDT; 35s ago
Docs: man:cockpit-ws(8)
Listen: 0.0.0.0:9090 (Stream)
Process: 6563 ExecStartPost=/usr/share/cockpit/motd/update-motd localhost (code=exited, status=0/SUCCESS)
Process: 6570 ExecStartPost=/bin/ln -snf active.motd /run/cockpit/motd (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 2181)
CGroup: /system.slice/cockpit.socket
Using Cockpit
Connecting
The default listening port is 9090. Open your favorite web browser and enter the address, for example: https://pibox:9090
.
Cockpit home page
You can now log in with your normal account. Similarly, this account needs to have sudo
privileges – likely the same account you used for SSH and running Apt. Make sure to check the box “Reuse my password for privileged tasks”.
Managing Your Raspberry Pi
The initial screen of Cockpit starts with the “System” page, providing detailed information and charts of current CPU and memory usage.
Initial Cockpit screen
You can see hardware details from this screen.
Cockpit hardware details
Expand the left column (e.g., logs, storage, services, etc.) by clicking each item. These are standard Cockpit sections and self-explanatory. Let me quickly describe each section.
Logs
This section displays logs. They can be filtered by date and severity.
Storage
The storage section displays the physical drives and RAID devices that are installed. Details such as size, serial number, etc., are displayed. It also shows charts of read/write activity and actual space usage. Specific logs for storage are displayed at the bottom.
Network
This section displays sending and receiving activity, IP addresses, and network-specific logs. You can also use the corresponding buttons to add more network devices, such as bonds, bridges, and VLANs.
Accounts
This section displays existing accounts. Click each account to manage it, or use the create new account button to add users. Accounts can also be deleted.
Services
This section allows the administrator to view the status of all system services. Clicking any service will take you to a screen with standard tasks for starting, restarting, and disabling.
Applications
Typically, this screen provides various applications for management functions, such as the 389 directory server or creating Podman containers. However, on my Raspberry Pi OS, this screen only shows “No applications installed or available.” This may not have been implemented at the time of writing this article. Although, you might wonder if this type of program is too heavy for Raspberry Pi hardware.
Software Updates
For any system administrator, keeping software up to date is one of the most important tasks. The software update section of Cockpit can check for and perform updates.
Software updates in Cockpit
Terminal
One of the most convenient features of Cockpit is the terminal. You can use it instead of opening a separate terminal emulator and using SSH. I used the terminal to install ScreenFetch:
$ sudo apt install screenfetch
Using ScreenFetch generated this screenshot:
Terminal in Cockpit
Central Control with Cockpit
Cockpit performs on the Raspberry Pi just as it does on other Linux systems. You can add it to the dashboard for centralized control. It allows enterprises to integrate Raspberry Pi-based services and systems into their overall Linux infrastructure anywhere Cockpit serves as a management dashboard solution. This is very convenient since Raspberry Pi often runs in high-density rack data centers in a headless manner, and these data centers often lack KVM access.
via: https://opensource.com/article/21/5/raspberry-pi-cockpit
Author: Alan Formy-Duval Topic: lujun9972 Translator: RiaXu Proofreader: wxy
This article is originally compiled by LCTT and honorably published by Linux China