The Cockpit is a free and open-source server management application sponsored by Red Hat. It comes with a simple web-based admin interface to manage the server through the web browser instead of cli. It also provides information on CPU load, filesystem statistics, processes, and further information. It allows you to perform day-to-day system administrative tasks including, creating and managing users, troubleshoots network issues, upload and download files, and more.

In this post, we will show you how to install and use Cockpit on Debian 11.

Prerequisites

  • A server running Debian 11.
  • A root password is configured on the server.

Install Cockpit on Debian 11

By default, the Cockpit package is included in the Debian 11 default repository. You can install it easily using the following command:

apt-get install cockpit -y

After installing Cockpit, run the following command to install the Podman module:

apt-get install cockpit-podman -y

After the successfull installation, start the Cockpit service and enable it to start at system reboot:

systemctl start cockpit

systemctl enable cockpit

To check the status of the Cockpit, run the following command:

systemctl status cockpit

You should see the following output:

? cockpit.service - Cockpit Web Service
     Loaded: loaded (/lib/systemd/system/cockpit.service; static)
     Active: active (running) since Sat 2021-10-09 07:34:10 UTC; 5s ago
TriggeredBy: ? cockpit.socket
       Docs: man:cockpit-ws(8)
    Process: 16211 ExecStartPre=/usr/sbin/remotectl certificate --ensure --user=root --group=cockpit-ws --selinux-type= (code=exited, status=0>
   Main PID: 16214 (cockpit-tls)
      Tasks: 1 (limit: 2341)
     Memory: 1.3M
        CPU: 101ms
     CGroup: /system.slice/cockpit.service
             ??16214 /usr/lib/cockpit/cockpit-tls

Oct 09 07:34:10 debian11 systemd[1]: Starting Cockpit Web Service...
Oct 09 07:34:10 debian11 systemd[1]: Started Cockpit Web Service.

By default, Cockpit listens on port 9090. You can check it with the following command:

ss -antpl | grep 9090

You should see the following output:

LISTEN 0      4096               *:9090            *:*    users:(("cockpit-tls",pid=16214,fd=3),("systemd",pid=1,fd=79))

Configure Firewall for Cockpit

If the UFW firewall is installed and configured on your system then you will need to allow ports 80 and 9090 through the UFW firewall.

You can allow both ports using the following command:

ufw allow 9090

ufw allow 80

Next, reload the UFW firewall with the following command:

ufw reload

You can now check the status of UFW firewall rules using the following command:

ufw status

You should see the following output:

Status: active

To                         Action      From
--                         ------      ----
22                         ALLOW       Anywhere                  
80                         ALLOW       Anywhere                  
9090                       ALLOW       Anywhere                  
22 (v6)                    ALLOW       Anywhere (v6)             
80 (v6)                    ALLOW       Anywhere (v6)             
9090 (v6)                  ALLOW       Anywhere (v6)             

Access Cockpit Web UI

Now, open your web browser and access the Cockpit web interface using the URL http://your-server-ip:9090. You should see the Cockpit login page:

<img alt="Cockpit login" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/10/echo/p1.png616827d6d9990.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="395" loading="lazy" src="data:image/svg xml,” width=”750″>

Provide your root username, password and click on the Login. You should see the Cockpit dashboard:

<img alt="Cockpit dashboard" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/10/echo/p2.png616827d71478e.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="387" loading="lazy" src="data:image/svg xml,” width=”750″>

In the left pane, click on the Storage to see your system’s partition information:

<img alt="Storage stats" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/10/echo/p3.png616827d73c4b6.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="390" loading="lazy" src="data:image/svg xml,” width=”750″>

Click on the Networking. You should see the network-related information on the following screen:

<img alt="Network stats" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/10/echo/p5.png616827d764727.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="390" loading="lazy" src="data:image/svg xml,” width=”750″>

Click on the Podman Containers. You should see all containers and images:

<img alt="Podman containers" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/10/echo/p6.png616827d78567f.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="387" loading="lazy" src="data:image/svg xml,” width=”750″>

Click on the Services. You should see all system services.

<img alt="Services" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/10/echo/p7.png616827d7c3168.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="386" loading="lazy" src="data:image/svg xml,” width=”750″>

Click on the Applications. You should see all installed applications.

<img alt="Applications" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/10/echo/p8.png616827d7eaaaf.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="388" loading="lazy" src="data:image/svg xml,” width=”750″>

Click on the Software Updates. You should see all available updates.

<img alt="Install updates" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/10/echo/p9.png616827d838224.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="388" loading="lazy" src="data:image/svg xml,” width=”750″>

Click on the Terminal. You can connect to your server’s command-line interface.

<img alt="Terminal" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/10/echo/p10.png616827d85e456.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="388" loading="lazy" src="data:image/svg xml,” width=”750″>

Conclusion

That’s it for now. You have successfully installed Cockpit on Debian 11. The Cockpit is very useful for those who don’t know the Linux command-line. Cockpit helps them to perform some basic tasks and monitor the remote Linux servers.

<img alt="Hitesh Jethva" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/10/echo/hitesh-80.jpg616827d874858.jpg" ezimgfmt="rs rscb5 src ng ngcb5" src="data:image/svg xml,”>

About Hitesh Jethva

Over 8 years of experience as a Linux system administrator. My skills include a depth knowledge of Redhat/Centos, Ubuntu Nginx and Apache, Mysql, Subversion, Linux, Ubuntu, web hosting, web server, Squid proxy, NFS, FTP, DNS, Samba, LDAP, OpenVPN, Haproxy, Amazon web services, WHMCS, OpenStack Cloud, Postfix Mail Server, Security etc.