Cockpit is a free and open-source server management console that makes it easy to administer your Linux servers via a web browser. It offers a web-based control panel to manage your server via the web browser. It is specially designed for beginner users unfamiliar with the Linux command line. With Cockpit, you can monitor CPU load, filesystem statistics, processes, and more information. You can also perform system administration tasks such as creating and managing users, troubleshooting network issues, uploading and downloading files, and more using Cockpit.

In this tutorial, we will show you how to install and use Cockpit on Ubuntu 22.04.

Prerequisites

  • A server running Ubuntu 22.04.
  • A root password is configured on the server.

Install Cockpit on Ubuntu 22.04

By default, the Cockpit package is included in the Ubuntu 22.04 default repository. You can install it by running 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

Once the Cockpit is installed, start the Cockpit service and enable it to start at system reboot:

systemctl start cockpit

systemctl enable cockpit

you can also check the status of the Cockpit using 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 Mon 2022-12-05 15:15:24 UTC; 8s ago
TriggeredBy: ? cockpit.socket
       Docs: man:cockpit-ws(8)
    Process: 16161 ExecStartPre=/usr/lib/cockpit/cockpit-certificate-ensure --for-cockpit-tls (code=exited, status=0/SUCCESS)
   Main PID: 16176 (cockpit-tls)
      Tasks: 1 (limit: 4579)
     Memory: 956.0K
        CPU: 363ms
     CGroup: /system.slice/cockpit.service
             ??16176 /usr/lib/cockpit/cockpit-tls

Dec 05 15:15:24 ubuntu2204 systemd[1]: Starting Cockpit Web Service...
Dec 05 15:15:24 ubuntu2204 cockpit-certificate-ensure[16168]: /usr/lib/cockpit/cockpit-certificate-helper: line 32: sscg: command not found
Dec 05 15:15:24 ubuntu2204 cockpit-certificate-ensure[16169]: .. ... ..                                                                 *....>
Dec 05 15:15:24 ubuntu2204 cockpit-certificate-ensure[16169]: ... ........... ... .......... .. ... . ..... ....... .. . .. .... ......... ..>
Dec 05 15:15:24 ubuntu2204 cockpit-certificate-ensure[16169]: -----
Dec 05 15:15:24 ubuntu2204 systemd[1]: Started Cockpit Web Service.

At this point, the Cockpit is started and 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=16176,fd=3),("systemd",pid=1,fd=61))

Configure UFW Firewall

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 Interface

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

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/10/echo/p1.png653bf8a6a054c.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="367" loading="lazy" src="data:image/svg xml,” width=”750″>

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

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/10/echo/p2.png653bf8a6b6f93.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="370" loading="lazy" src="data:image/svg xml,” width=”750″>

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

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/10/echo/p3.png653bf8a6d9e72.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="371" 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="" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/10/echo/p4.png653bf8a6ecd95.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="372" loading="lazy" src="data:image/svg xml,” width=”750″>

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

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/10/echo/p5.png653bf8a7141e8.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="370" loading="lazy" src="data:image/svg xml,” width=”750″>

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

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/10/echo/p6.png653bf8a727667.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="371" loading="lazy" src="data:image/svg xml,” width=”750″>

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

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/10/echo/p7.png653bf8a783deb.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="366" 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="" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/10/echo/p8.png653bf8a7eac90.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="367" loading="lazy" src="data:image/svg xml,” width=”750″>

Conclusion

Congratulations! you have successfully installed Cockpit on Ubuntu 22.04. Cockpit is a very useful tool for Linux users to manage and configure services on Linux-based servers. Feel free to ask me if you have any questions.

<img alt="Hitesh Jethva" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/10/echo/hitesh-80.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="76" src="data:image/svg xml,” width=”80″>

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.