Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide

Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide
Introduction: Build your Raspberry Pi control center with Cockpit.
Word count: 3025, estimated reading time: 4 minutes
https://linux.cn/article-13487-1.htmlAuthor: Alan Formy-duvalTranslator: RiaXu

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.

Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide

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

Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide

Using Cockpit

Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide

Connecting

The default listening port is 9090. Open your favorite web browser and enter the address, for example: https://pibox:9090.

Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide

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 with Cockpit | A Comprehensive Guide

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.

Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide

Initial Cockpit screen

You can see hardware details from this screen.

Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide

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.

Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide

Logs

This section displays logs. They can be filtered by date and severity.

Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide

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.

Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide

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.

Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide

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.

Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide

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.

Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide

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.

Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide

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.

Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide

Software updates in Cockpit

Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide

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:

Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide

Terminal in Cockpit

Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide

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

Managing Your Raspberry Pi with Cockpit | A Comprehensive Guide
Welcome to reproduce in accordance with the CC-BY-NC-SA agreement,
If you need to reproduce, please leave a message under the article “Reproduce: Public account name“,
We will add you to the whitelist and authorize “Reproducing articles may be modified“.

Leave a Comment

×