Cockpit Installation

Last updated: August 1, 2024

Cockpit is a tool for server administration that provides you with real-time information about your server's status. It displays data on CPU usage, filesystem statistics, processes, and other relevant details. One of the advantages of using Cockpit is that it does not consume any server resources until you log in to the control panel. The service is only activated when you access the control panel.

Cockpit enables you to perform various server administration tasks, such as managing users and addressing network issues. It also allows you to access a terminal from your computer or phone's browser. To log in and manage the system, Cockpit utilizes your system's users and sudo for privilege escalation. As a result, it does not introduce an additional layer of security considerations by creating a separate set of Cockpit-only users for your server.

Instructions

Using the below guides you can install Cockpit on various different Linux OS's.

Ubuntu

Ubuntu 17.04 and later:

Install cockpit:

. /etc/os-release

sudo apt install -t ${VERSION_CODENAME}-backports cockpit

Enable cockpit:

sudo systemctl enable --now cockpit.socket

Fedora

Install cockpit:

sudo dnf install cockpit

Enable cockpit:

sudo systemctl enable --now cockpit.socket

Ensure that the firewall is open:

sudo firewall-cmd --add-service=cockpit

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

CentOS

CentOS 7 and later:

Install cockpit:

sudo yum install cockpit

Enable cockpit:

sudo systemctl enable --now cockpit.socket

Open the firewall:

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

sudo firewall-cmd --reload

Debian

Debian 10 and later:

To get the latest version, we recommend to enable the backports repository (as root):

. /etc/os-release

echo "deb http://deb.debian.org/debian ${VERSION_CODENAME}-backports main" > \

/etc/apt/sources.list.d/backports.list

apt update

Install or update the package:

apt install -t ${VERSION_CODENAME}-backports cockpit

Rocky Linux

Rocky Linux 8 and later:

Install cockpit

sudo yum install cockpit

Enable cockpit:

sudo systemctl enable --now cockpit.socket

Allow port through firewall:

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

sudo firewall-cmd --reload