Learning how to install Cockpit Web Console on Linux is your fast-track ticket to a smooth and attractive GUI. Here’s everything you need to know about it.
If you’re also looking to set up a Linux server, you will have to be able to access it to do some administrative tasks. For those who are new to Linux and don’t want to learn how to use the terminal, or even if you’re an expert, sometimes it just feels nicer to be able to do things through a GUI and not a terminal interface.
Having a GUI means seeing important information like CPU/Memory usage. And storage/network information in a nicely presented view rather than just text inside a terminal.
How to Install Cockpit Web Console on Ubuntu 22.04
This is where the Cockpit Web Console comes in. It’s a free and open-source web-based graphical interface for servers. Intended also for everyone, beginners who are entirely new to Linux and experts at using and managing Linux.
Cockpit is a web-based tool, and you can also use it from any operating system to manage your Linux server. Because all you need is a network connection and an internet browser.
Update Your Current Package List
First, we will update our current package list by running the
apt update command.
$ sudo apt update
This won’t update our packages but simply get the newest versions for our packages and their dependencies. So that we can update those latest versions later when we run the apt upgrade.
Install Cockpit Using apt
Ubuntu provides cockpit in their official repositories. All we need to do is install it using
$ sudo apt install cockpit -y
-y flag means we will accept any Yes/no prompts.
Now Cockpit is installed alongside any other packages and dependencies it might need.
We can verify our installation by running the following command.
$ apt -qq list cockpit
If you’re running Cockpit inside a Kernel-based Virtual Machine (KVM) like us, you will need to install the cockpit-machines package.
$ sudo apt install cockpit-machines -y
Start the Cockpit Service
The Cockpit isn’t run like a regular program, but rather a service, in our case, a
To start it, we run the same command for running any other
$ sudo systemctl enable --now cockpit.socket
systemctl enable command means we want this service to start every time upon boot, and the
–now flag means we also want the service to start right now.
We can check if the service is running by using
$ sudo systemctl status cockpit
The Cockpit runs by listening on port TCP/9090. We can check this by running the following command.
$ ss -tunlpe | grep cockpit
If a firewall is enabled, you will need to allow the TCP port 9090.
$ sudo ufw allo 9090/tcp
Accessing the Cockpit Web Console
To access the Cockpit Web Console, we need to open up a web browser. Type in our machine’s IP, and add port 9090 at the end.
If you want to try this out on the same machine running Cockpit, you can simply type
localhost:9090 in your web browser.
But you will be accessing it most of the time from a different machine. So we need to find out the IP address of our server.
We can do this by running the following command.
$ ip a
Here we can see the local IP address of our machine. Which we can now use to access the Cockpit Web Console from any other machine on our network.
Simply type this address into the search bar on our web browser and again add port 9090 at the end.
After logging in using our username and password, we can see the dashboard.
From here, we can see various information about our system. And we even have a terminal we can use if we need to do something that isn’t available in the Cockpit console.
Since we have logged in with a regular account, we receive a notification at the top. Telling us to turn on administrative access. Click on the button and type in your password. The account has to have sudo privileges but can also be avoided by logging in as root.
We have learned how to install Cockpit and enable its service. Allow a port in our firewall, and find our IP address. After a successful installation, we can now access it from any web browser. To look at information about our system, like storage, networking, performance, etc.
We can also manage our virtual machines, accounts, services, and applications. On top of that, we can perform system updates. And even have a terminal ready to go for more complicated tasks not available in the Cockpit console.
In the guide above, we have explained everything you need to know about Cockpit and how to install this GUI on Linux with step-by-step instructions. If you would like to know more about Cockpit, you can check out the official website, where you can learn more about all of the available features and their full capabilities on the official website.
If this guide helped you, please share it.