Tutorial-9122023

How to Install Cockpit Web Console on Ubuntu 22.04

How to Install Cockpit Web Console on Ubuntu 22.04

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:

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

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

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

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

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

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

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

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.

Đăng ký liền tay Nhận Ngay Bài Mới

Subscribe ngay

Cám ơn bạn đã đăng ký !

Lỗi đăng ký !

Add Comment

Click here to post a comment

Đăng ký liền tay
Nhận Ngay Bài Mới

Subscribe ngay

Cám ơn bạn đã đăng ký !

Lỗi đăng ký !