On this page
- Why choose Cockpit over a hosting panel?
- Which images and plans suit Cockpit?
- How do I install Cockpit on Ubuntu and Debian?
- How do I install Cockpit on Rocky Linux and AlmaLinux?
- How do I start Cockpit and limit who can reach it?
- What can I do once I am logged in?
- Which extra Cockpit pages are worth adding?
- How do I replace the self-signed certificate?
- What if the console will not load or log in?
- Questions
Why choose Cockpit over a hosting panel?
Cockpit is a thin layer over the operating system rather than a product that takes it over. It talks to systemd, journald, NetworkManager, storaged and PackageKit through their standard interfaces and keeps no configuration of its own beyond a small settings file. When you close the browser tab, Cockpit stops: the socket unit starts the web service only when a connection arrives, so it uses no memory while nobody is logged in.
That design makes it a good fit for people who mostly work over SSH and want a quick visual check, or who share a server with someone less at home on the command line. It does not create websites, mailboxes or DNS zones. For that kind of hosting work look at Virtualmin; for a broader set of configuration modules see Webmin.
Which images and plans suit Cockpit?
Any of our Ubuntu 24.04 and 22.04, Debian 12 and 13, Rocky Linux 9 or AlmaLinux 9 images works. Because Cockpit only reads and drives existing services, it can be added to a server that already runs workloads, though a clean image keeps the first setup simple; reinstall from the Settings tab if you want to start over (see reinstalling an image). A 1 GB plan is plenty for the console itself.
Connect over SSH as your sudo user first, as described in your first SSH session. Cockpit logins use passwords, so make sure that user has one:
sudo passwd deploy
id deployThe output of id should list the sudo group on Ubuntu and Debian or wheel on Rocky and Alma, otherwise the console opens in limited mode.
How do I install Cockpit on Ubuntu and Debian?
The Cockpit project recommends the backports repository on these systems because it carries a much newer release than the frozen main archive. Ubuntu enables backports by default, so a single command is enough:
. /etc/os-release
sudo apt update
sudo apt install -t ${VERSION_CODENAME}-backports cockpitDebian needs the backports line added first:
. /etc/os-release
echo "deb http://deb.debian.org/debian ${VERSION_CODENAME}-backports main" | sudo tee /etc/apt/sources.list.d/backports.list
sudo apt update
sudo apt install -t ${VERSION_CODENAME}-backports cockpitCompare the candidate versions before and after with apt policy cockpit. The package from the main archive also works if you prefer fewer repositories.
How do I install Cockpit on Rocky Linux and AlmaLinux?
Cockpit is part of the base repositories on both systems and is sometimes already present. Install it, start the socket and allow the predefined firewalld service:
sudo dnf install cockpit
sudo systemctl enable --now cockpit.socket
rpm -q cockpit
sudo firewall-cmd --permanent --add-service=cockpit
sudo firewall-cmd --reloadThe add-service=cockpit rule opens port 9090 to every address. Restrict it instead with a rich rule for your own IP, as shown in the next section, if you do not want the login page public.
How do I start Cockpit and limit who can reach it?
Enable the socket, confirm it listens, then open the port only for your own address. Replace 203.0.113.7 with your public IP:
sudo systemctl enable --now cockpit.socket
sudo ss -tlnp | grep 9090
# Ubuntu and Debian
sudo ufw allow from 203.0.113.7 to any port 9090 proto tcp
sudo ufw status
# Rocky Linux and AlmaLinux
sudo firewall-cmd --permanent --add-rich-rule="rule family=ipv4 source address=203.0.113.7 port port=9090 protocol=tcp accept"
sudo firewall-cmd --reloadFor the tightest setup, bind the socket to localhost and use an SSH tunnel. Run sudo systemctl edit cockpit.socket and add:
[Socket]
ListenStream=
ListenStream=127.0.0.1:9090Then sudo systemctl daemon-reload && sudo systemctl restart cockpit.socket, and from your computer run ssh -L 9090:127.0.0.1:9090 deploy@198.51.100.24 and browse to https://localhost:9090. On Rocky and Alma, moving Cockpit to a different port also needs sudo semanage port -a -t websm_port_t -p tcp 9443 so SELinux allows it.
What can I do once I am logged in?
Browse to https://198.51.100.24:9090, accept the first certificate warning and sign in as deploy. Click the button to turn on administrative access, which uses sudo behind the scenes. The main pages are:
- Overview: CPU, memory, disk and network graphs, host name and uptime.
- Logs: the systemd journal filtered by priority, service or time.
- Services: start, stop, enable or inspect any unit and its timers.
- Software updates: pending packages, with an option for automatic security updates.
- Accounts: create users, set passwords and paste SSH public keys.
- Terminal: a full shell in the browser, useful when your SSH client is not at hand.
Root is listed in /etc/cockpit/disallowed-users on many builds, which is why logging in as a sudo user is the expected path.
Which extra Cockpit pages are worth adding?
Add-ons are ordinary packages. A few that suit a VPS:
# Ubuntu and Debian
sudo apt install cockpit-podman cockpit-pcp
# Rocky Linux and AlmaLinux
sudo dnf install cockpit-podman cockpit-pcpcockpit-podman lists and runs containers through Podman (see the Podman guide), and cockpit-pcp keeps performance history so the graphs reach back further than the current session. Newer releases also offer a file browser package called cockpit-files. Reload the browser tab after installing a package to see its menu entry.
How do I replace the self-signed certificate?
Cockpit reads certificates from /etc/cockpit/ws-certs.d/ and uses the file that sorts last alphabetically. Once you have a certificate for panel.example.net (from Certbot, as in the Let's Encrypt guide), copy the pair in with matching names and restart:
sudo cp /etc/letsencrypt/live/panel.example.net/fullchain.pem /etc/cockpit/ws-certs.d/50-panel.cert
sudo cp /etc/letsencrypt/live/panel.example.net/privkey.pem /etc/cockpit/ws-certs.d/50-panel.key
sudo chmod 640 /etc/cockpit/ws-certs.d/50-panel.key
sudo systemctl restart cockpitRepeat the copy in a Certbot deploy hook so renewals reach Cockpit too.
What if the console will not load or log in?
Check the socket and the service journal first:
sudo systemctl status cockpit.socket --no-pager
sudo journalctl -u cockpit -n 50 --no-pagerA login that fails with correct details usually means the user has no password, or is listed in disallowed-users. A timeout points at the firewall rule or a changed home IP. On Ubuntu, the networking page may show interfaces as read only because the image uses netplan with systemd-networkd rather than NetworkManager; that is expected and does not affect the rest of the console.
Plans that fit this guide
Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.
Questions about Cockpit server console in the browser
Does Cockpit run all the time?
No. The cockpit.socket unit waits on port 9090 and starts the web service only when someone connects, so an idle server spends no memory on it.
Can I log in as root?
Many builds block root in /etc/cockpit/disallowed-users. Log in as a sudo user and switch on administrative access inside the console instead.
Will Cockpit change my configuration files?
Only when you change something through it. It drives systemd and other system services directly, so a setting made in Cockpit is the same as one made over SSH.
How do I update Cockpit?
It updates with the rest of the system: sudo apt upgrade (keeping the backports target) or sudo dnf upgrade.
Can one Cockpit page manage several servers?
Yes. Add other hosts from the host switcher; Cockpit connects to them over SSH, so the remote servers need Cockpit installed but not port 9090 open.