How to install Cockpit on Ubuntu 22.04?

In a nutshell, Cockpit is a web-based tool that provides a graphical interface for server administration.

One of its main features is that it is open source and free. This makes it suitable for many projects.

Although it may seem like a tool oriented to novices, the truth is that it is not because everyone who is familiar with Linux can find it very useful.

It is possible to learn more about Linux and a server, but with a modern and easy to use interface.

Simple to use, Cockpit makes it possible for you to discover Linux without having to memorize so many commands or if you don’t have too much knowledge. Basically, you could consider Cockpit to be a desktop GUI but for individual servers.

Another thing that’s pretty important about Cockpit is that it won’t interfere with the work you’re already doing with Ansible or Docker or any other technology.

What can I do with Cockpit?

Some things you can do with Cockpit are:

  • Make changes to network settings.
  • Configure a firewall and its rules
  • Create and manage virtual machines
  • Verify system logs
    -Upgrade packages

And much, much more.

Install Cockpit on Ubuntu 22.04

Fortunately, Cockpit has great support for Linux and is included in the official Ubuntu repositories.

So let’s get started. First, log in via SSH to your server.

Then, update it

sudo apt update
sudo apt upgrade

Thereafter, you can install Cockpit using the following command:

sudo apt install cockpit

When the installation is finished, you can start and enable the Cockpit service on the system.

sudo systemctl enable --now cockpit

Cockpit is now installed and running on your system.

To log in to Cockpit, just use your system username. But it is best that this user has sufficient permissions to perform certain tasks. So, you may need to add the user to the sudo group

sudo usermod -aG sudo $USER

You can replace $USER with the name of another user because this variable gets the current user from the system.

If you use containers, then you should install the Cockpit package for podman.

sudo apt install podman cockpit-podman

To apply the changes, you can restart Cockpit

sudo systemctl restart cockpit

Accessing the Cockpit web interface

The next step is to access Cockpit from a web browser with the address You accept the risks, and you will see the login page.

Cockpit login screen
Cockpit login screen

Log in with a system user, and you will be able to use Cockpit.

Cockpit running on Ubuntu 22.04
Cockpit running on Ubuntu 22.04

Remember that port 9090 must be available in the firewall.

Uninstall Cockpit on Ubuntu 22.04

If you no longer want to use Cockpit, then you can remove it from the system with the command

sudo apt remove cockpit

Then it will no longer be on the system.

Conclusion

Administering a server is not an easy task, but applications like Cockpit can make it a little more manageable. So, it’s a good idea to know how to install it correctly from the official Ubuntu repositories.

I hope you liked this post and help us to spread this article with your friends.

Share This:

Leave a Comment

Your email address will not be published.