Tutorials  /  Ubuntu

Install Cockpit on Ubuntu 24.04 with SSL & Podman Support

Ccentron Redaktion · April 2025 ·7 min read ·Ubuntu, Tutorial

Cockpit provides a browser-based control panel for managing server operations, including service tracking, app handling, networking, storage, log viewing, and user account administration. It offers an intuitive and modular interface, making it adaptable through various plugins for comprehensive server oversight.

This tutorial guides you through setting up Cockpit on Ubuntu 24.04, allowing you to manage and monitor server activities through a web-based dashboard.

Prerequisites

Before proceeding with the setup, ensure you have the following:

  • An Ubuntu 24.04 server instance.
  • A domain A record configured to point to your server’s IP, such as cockpit.example.com.
  • A dedicated non-root user with sudo privileges for Cockpit access, such as cockpit_admin.
VM

Matching infrastructure at centron

Ubuntu servers without your own hardware: ccloud³ VMs with full root access from €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →

Installing Cockpit on Ubuntu 24.04

Since Cockpit is part of Ubuntu's standard repositories, you can follow these steps to update your system and install it.

Step 1: Refresh the package index

Console
$ sudo apt update

Step 2: Install Cockpit

Console
$ sudo apt install cockpit -y

Step 3: Set Cockpit to start on boot

Console
$ sudo systemctl enable cockpit.socket

Step 4: Launch the Cockpit service

Console
$ sudo systemctl start cockpit

Step 5: Confirm the Cockpit service is active

Console
$ sudo systemctl status cockpit

Sample Output:

YAML
● cockpit.service - Cockpit Web Service
     Loaded: loaded (/usr/lib/systemd/system/cockpit.service; static)
     Active: active (running) since Tue 2024-12-10 18:50:56 UTC; 7s ago
TriggeredBy: ● cockpit.socket
       Docs: man:cockpit-ws(8)
    Process: 12887 ExecStartPre=/usr/lib/cockpit/cockpit-certificate-ensure --for-cockpit-tls code=exited, >   Main PID: 12900 (cockpit-tls)
      Tasks: 1 (limit: 1061)
     Memory: 2.7M (peak: 4.0M)
        CPU: 229ms
     CGroup: /system.slice/cockpit.service
             └─12900 /usr/lib/cockpit/cockpit-tls

With Cockpit successfully installed, it now listens for incoming connections on TCP port 9090.

If you're operating on Debian 12, consider installing Cockpit as well to streamline server management through its browser-accessible, easy-to-navigate interface.

Enable SSL Encryption for Cockpit with Trusted Certificates

By default, Cockpit uses TCP port 9090 to accept incoming connections, but these are not encrypted. Accessing the web dashboard through unencrypted HTTP traffic may expose your server to various vulnerabilities. To secure the connection, you can enable HTTPS using verified SSL certificates from Let's Encrypt. Below are the steps to configure SSL certificates for Cockpit using your domain name.

Step 1: Check if UFW Firewall is Active

Console
$ sudo ufw status

Step 2: Allow Required Network Ports

Permit traffic to the Cockpit port:

Console
$ sudo ufw allow 9090/tcp

Allow HTTP port for domain validation:

Console
$ sudo ufw allow 80/tcp

Allow HTTPS connections for secure access:

Console
$ sudo ufw allow 443/tcp

Reload UFW to activate the new rules:

Console
$ sudo ufw reload

Step 3: Install Certbot with Snap

Install Snapd:

Console
$ sudo apt install snapd -y

Use Snap to install Certbot:

Console
$ sudo snap install certbot --classic

Step 4: Obtain a Let’s Encrypt Certificate

Request a new certificate using your domain and email. Replace the placeholders with your own data:

Console
$ sudo certbot --standalone certonly -d cockpit.example.com -m cockpit@example.com --agree-tos

Run a test renewal to confirm automatic renewal is working:

Console
$ sudo certbot renew --dry-run

Step 5: Configure Cockpit to Use the Certificate

Merge the certificate and private key into one file:

Console
$ sudo cat /etc/letsencrypt/live/cockpit.example.com/fullchain.pem /etc/letsencrypt/live/cockpit.example.com/privkey.pem > cockpit.cert

Move the file to the appropriate Cockpit certificate directory:

Console
$ sudo mv cockpit.cert /etc/cockpit/ws-certs.d/

Restart Cockpit to apply SSL changes:

Console
$ sudo systemctl restart cockpit.socket

Access the Cockpit Web Interface

Use the following instructions to log in to the Cockpit web UI and begin managing your server:

Open a browser and go to:

https://cockpit.example.com:9090

Log in using your sudo-enabled user credentials. Cockpit doesn’t allow direct root logins via the interface, so make sure you authenticate with a non-root user account.

Once logged in, enable elevated privileges by clicking Turn on administrative access in the sidebar and entering your password again.

Administering the Server with Cockpit

Monitor System Health

In the Overview section, monitor system health, CPU and memory usage, active services, and performance metrics. Click View metrics and history for detailed usage statistics.

Manage Storage Devices

Select Storage from the menu to manage disk drives, view read/write performance, and diagnose storage-related issues.

Control System Services

Under Services, start, stop, or restart all system services including timers, sockets, paths, and targets.

Track Network Usage

Navigate to Networking to monitor active interfaces, view live bandwidth usage, and inspect logs for diagnosing network problems.

Inspect System Logs

Click Logs to filter entries by date, severity, and source daemon. Use filters and identifiers to isolate specific log events.

Manage Users and Groups

In the Accounts section, see all server users and groups. Click Create new account to add users with custom settings.

Open a Terminal

Use Terminal under the Tools section for direct shell access to your server environment.

Use Cockpit Podman to Manage Containers

Cockpit supports plugins like Cockpit Podman to manage containers visually. Follow these steps to set it up:

Step 1: Install the Podman Plugin

Console
$ sudo apt update
$ sudo apt install cockpit-podman -y

Step 2: Allow Traffic Routing to Containers

Console
$ sudo ufw route allow proto tcp from any to any port 80
$ sudo ufw reload

Step 3: Deploy and Run a Container

In the Cockpit UI, click Podman containers, then Create container.

Provide a container name like app-example and enter Nginx as the image. Select docker.io/library/nginx.

Under Integration, map port 80 for both host and container, leaving IP field blank.

Click Create and run to launch the container.

Once running, you’ll see its state listed as Running. Visit http://SERVER-IP in your browser to confirm the Nginx default page is displayed.

Conclusion

In this tutorial, you installed Cockpit on Ubuntu 24.04 and used the Podman plugin to deploy containerized apps. Cockpit offers a flexible and powerful interface for managing server tasks. Additional features can be added by installing extensions such as Cockpit-Podman. Visit the official documentation for more customization options and details.

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Ubuntu
Teilen
Noch offene Fragen?

Our team will help you with your specific setup - in German or English, by people who run the platform themselves.

War dieses Tutorial hilfreich?

Your answer is stored anonymously and helps us improve our tutorials.

Kommentare

No comments yet - be the first to ask a question about this tutorial.

Sign in to comment

Comments are open to centron customers. Sign in to your account to ask a question about this tutorial.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren