Cockpit Setup

Web-based server management on Ubuntu.

What is Cockpit?

Cockpit is a web-based server management tool that gives you a graphical interface for system administration tasks — monitoring resources, managing services, configuring storage, and more. Lightweight and runs on port 9090.

1 Install Cockpit

bash
sudo apt update
sudo apt install cockpit -y

2 Start & Enable Cockpit

bash
sudo systemctl enable --now cockpit.socket

Check the status:

bash
sudo systemctl status cockpit.socket

3 Configure Firewall

bash
sudo ufw allow 9090/tcp

4 Access Cockpit

Open your browser and navigate to:

bash
https://your-server-ip:9090

Log in with your system username and password (user with sudo privileges).

5 Optional: Install Cockpit Modules

Extend Cockpit's functionality with additional modules:

bash
sudo apt install cockpit-machines cockpit-podman cockpit-storaged -y
cockpit-machines — Manage virtual machines (libvirt)
cockpit-podman — Manage containers
cockpit-storaged — Storage management

6 Nginx Reverse Proxy (Optional)

If you want to access Cockpit via your domain (e.g., cockpit.yourdomain.com):

nginx
server {
    listen 443 ssl;
    server_name cockpit.yourdomain.com;

    location / {
        proxy_pass https://127.0.0.1:9090;
        proxy_set_header Host $host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}
Home Buy Me a Beer