Install Cockpit on Linux: 6 Easy Steps and 3 Login Errors
Cockpit is a web console for Linux servers: you log in with a normal system account on port 9090 and get logs, services, storage, networking and updates in a browser. To install Cockpit takes one package and one systemd unit, but a few details decide whether the first login works: which unit to enable, why root is refused, and what the certificate warning means. I installed it on 22 November 2026 on a Debian 13 virtual machine (Cockpit 337-1+deb13u2) and checked each step with curl and ss; the commands for other distributions come from the official Running Cockpit page.
Contents
- Step 1: install Cockpit with the package manager
- Step 2: enable the socket, not the service
- Step 3: open the firewall
- Step 4: log in, and why root gets 403
- Step 5: understand the certificate warning
- Step 6: add the pages you need
- Common errors right after you install Cockpit
- Is Cockpit right for your server?
Step 1: install Cockpit with the package manager
# Debian / Ubuntu
sudo apt install cockpit
# Fedora, RHEL 8+, Rocky, Alma
sudo dnf install cockpit
# Arch
sudo pacman -S cockpit
According to the project page, Cockpit is installed by default on Fedora Server, is in RHEL 7 and later (RHEL 7 needs the Extras repository), and has been in Debian since version 10; for newer versions on Debian and Ubuntu LTS it recommends the backports repository. On Debian 13 the plain install took 53 seconds and gave these packages:
cockpit 337-1+deb13u2
cockpit-bridge 337-1+deb13u2
cockpit-system 337-1+deb13u2
cockpit-ws 337-1+deb13u2
The cockpit package depends on bridge, ws and system, and recommends three more pages:
Depends: cockpit-bridge
Depends: cockpit-ws
Depends: cockpit-system
Recommends: cockpit-storaged
Recommends: cockpit-networkmanager
Recommends: cockpit-packagekit
If you install with --no-install-recommends, the storage, network and updates pages are missing. That is a common reason for "my Cockpit has no Storage tab".
Step 2: enable the socket, not the service
The step people miss when they install Cockpit is the unit. Cockpit uses systemd socket activation. Right after the install on Debian, the socket was listening and the service was not running:
$ systemctl is-active cockpit.socket cockpit.service; ss -ltnp | grep 9090
active
inactive
LISTEN 0 4096 *:9090 *:* users:(("systemd",pid=1,fd=63))
The first request started it (cockpit.service became active), and afterwards cockpit-tls owned the port. On distributions where nothing is enabled after the package install, the documented command is sudo systemctl enable --now cockpit.socket. Do not enable cockpit.service directly; it is meant to be started by the socket.
Step 3: open the firewall
The official commands for firewalld are:
sudo firewall-cmd --add-service=cockpit
sudo firewall-cmd --add-service=cockpit --permanent
With ufw, allow TCP port 9090 instead. Better still, allow it only from your admin network or VPN, not from the whole internet: Cockpit is a full root-capable console for anyone with an admin account.
Step 4: log in, and why root gets 403
Browse to https://server:9090 and use a normal system account. I tested the login endpoint with curl, which sends the same basic authentication the login form uses:
$ curl -sk -o /dev/null -w "%{http_code}\n" -u admin1:Cockpit-Lab-1 https://127.0.0.1:9090/cockpit/login
200
$ curl -sk -o /dev/null -w "%{http_code}\n" -u admin1:wrong-pass https://127.0.0.1:9090/cockpit/login
401
$ curl -sk -o /dev/null -w "%{http_code}\n" -u root:Root-Lab-1 https://127.0.0.1:9090/cockpit/login
403
Root was refused with the right password. The reason is one file:
$ cat /etc/cockpit/disallowed-users
# List of users which are not allowed to login to Cockpit
root
Keep it that way. Log in as a user in the sudo (Debian/Ubuntu) or wheel (Fedora/RHEL) group and use the "Administrative access" switch in the web UI when you need root powers. That leaves a normal user name in the logs instead of a shared root login.
Step 5: understand the certificate warning
After you install Cockpit, your browser will warn about the certificate on the first visit. Cockpit created a self-signed one at first start:
$ ls /etc/cockpit/ws-certs.d/
0-self-signed.cert 0-self-signed.key
$ openssl x509 -in /etc/cockpit/ws-certs.d/0-self-signed.cert -noout -subject -issuer -enddate
subject=O=33618d82797a40fcae2610f644cf38d2, CN=lab
issuer=O=33618d82797a40fcae2610f644cf38d2, CN=lab
notAfter=Dec 22 04:10:44 2027 GMT
The journal showed how: the helper first tried sscg, which Debian did not install (cockpit-certificate-helper: line 31: sscg: command not found), and then generated the key with OpenSSL. That message is harmless. For a server people use daily, put a real certificate and key into /etc/cockpit/ws-certs.d/ with a name that sorts after 0-self-signed, or put Cockpit behind your existing reverse proxy.
One more observation: a plain http://127.0.0.1:9090/ request from the server itself also returned 200. I only tested from localhost, so do not read that as "HTTP works from outside"; check from another machine before you rely on it either way.
Step 6: add the pages you need
When you install Cockpit you get the basics; extra functions are separate packages. Debian 13 offered these:
cockpit-389-ds - Cockpit user interface for 389 Directory Server
cockpit-files - Cockpit component for file management
cockpit-machines - Cockpit user interface for virtual machines
cockpit-networkmanager - Cockpit user interface for networking
cockpit-packagekit - Cockpit user interface for apps and package updates
cockpit-podman - Cockpit component for Podman containers
cockpit-sosreport - Cockpit user interface for diagnostic reports
cockpit-storaged - Cockpit user interface for storage
cockpit-machines (KVM virtual machines) and cockpit-podman (containers) are the two most admins add after they install Cockpit.
Common errors right after you install Cockpit
| Symptom | Cause seen in the lab | Fix |
|---|---|---|
| Login fails for root with the right password | HTTP 403, root is listed in /etc/cockpit/disallowed-users | log in as a sudo/wheel user |
| Login fails for a normal user | HTTP 401 | check the password with su - user first |
| No Storage, Networking or Updates page | recommended packages not installed | install cockpit-storaged, cockpit-networkmanager, cockpit-packagekit |
| Browser certificate warning | self-signed 0-self-signed.cert | add your own certificate in ws-certs.d |
systemctl status cockpit says inactive | normal with socket activation until the first request | check cockpit.socket instead |
If you later decide to remove it, stop the socket first (systemctl disable --now cockpit.socket) and then remove the packages, so nothing keeps port 9090 open in the meantime.
Is Cockpit right for your server?
Cockpit does not keep its own configuration database: it calls the same systemd, journald, NetworkManager and storaged interfaces you use from the shell, so changes made in the browser and on the command line never fight each other. That is its biggest advantage over older panels such as Webmin. For desktop users who want to avoid the terminal altogether, using Linux without the command line covers the GUI tools. My checklist when I install Cockpit on a server: socket enabled, port 9090 limited to admin networks, root kept in disallowed-users, a real certificate, and only the extra pages you will actually use.
Comments
Post a Comment