Cockpit as Central Linux Administration Tool


Cockpit – what is that?

Cockpit is an easy-to-use GUI console for servers/desktops, designed for everyone, especially those who are:

  • new in Linux – both new admins and newbies who are starting the journey with new operating system like Linux
  • familiar with Linux – having basic information about the system or for people who want to administer a server in a simple (graphical) way
  • experienced administrators – who mainly use other administrative tools or want to have a preview of individual system components

Cockpit – short characteristics

  • web-based console – which means you can also access it via a mobile device
  • use of the same APIs as in the terminal – all actions immediately reflected on the console
  • availability of the terminal directly from the console – which gives you the possibility to manage the server from one central place (Singe Pane of Glass)

Cockpit enables a wide range of administrative tasks, including:

  • Managing and monitoring system services
  • Managing user accounts
  • Configuring network and firewall interfaces
  • Viewing system logs
  • Managing virtual machines
  • Creating diagnostic reports
  • Setting up kernel dump configurations
  • Configuring SELinux
  • Updating software
  • Managing additional cockpit plugins (apps)
  • Terminal support

Cockpit – why it’s worth it

  • graphic and user interface (GUI) designers are involved in the project
  • fully modular console, expandable with additional applications
  • possibility to create and write your own module and install it
  • the possibility to connect multiple servers to the console and control them from a single desktop/dashboard
  • is user-friendly and does not cause any problems cooperating with other management tools
  • is based on systemd socket, which means that it does not use any memory when not running
  • is based on existing functionality and by default does not require any initial configuration
  • the state or data of the server(s) is not stored anywhere, it uses the same API as the command line
  • having RBAC (Role-Based Access Control) which enforces no special permissions (does not run as root), creates a session, as a logged-in user and has the same permissions as that user (so to perform administrative tasks, the user needs sudo permission)
  • is free and fully customizable to your needs

Installation and configuration of Cockpit

For your information there are a lot of supported already operating system kinds that you can install and use the Cockpit in. I would give you an example how to install it on Centos8.

Installation and startup of the service:

$ yum install cockpit 
$ systemctl enable --now cockpit.socket 
$ systemctl status cockpit.socket 

Firewall configuration:

$ firewall-cmd --add-service=cockpit --permanent 
$ firewall-cmd --reload 

After that steps we should be able to access web GUI interface. Service should be exposed under following URL:

https://localhost:9090

or if you are accessing it from different server/host (instead of locally) you should connect to:

Please login with a normal user and password. If the user account has sudo privileges, this allows you to perform administrative tasks such as software installation, system configuration or SELinux configuration otherwise you will be limited to activities that corresponds to the user rights assigned on Linux operating system level.

Built-in modules in Cockpit:

  1. Storage – a disk space management application which supports LVM, NFS, RAID, iSCSI and more….
  2. Networking – a tool for network confguration and system firewall
  3. Accounts – for managing users and their privileges
  4. Services – used to manage and monitor system services

Additional administration packages:

  1. Dashboard (cockpit-dashboard)
  2. Performance co-pilot (cockpit-pcp)
  3. Podman Containers (cockpit-podman)
  4. Virtual Machines (cockpit-machines)
  5. Package Manager (cockpit-packagekit)
  6. Session Recording (cockpit-session-recording)

Lab Time

I have a recording that introduced the Cockpit on YouTube. It is in Polish but feel free to see it:

https://www.youtube.com/watch?v=9K5mxt7Yq1Y

The video provides a general overview of:

  • Cockpit console
  • LVM extension
  • managing Firewall rules
  • using Podman
  • using Session Recording (really awesome!)
  • virtual machines creation