Are you a Linux server administrator looking for an easy-to-use web-based control panel to manage your servers? Look no further than Cockpit! Cockpit is a free and open-source server management console specifically designed for beginners who are unfamiliar with the Linux command line. With Cockpit, you can easily monitor server statistics, manage users, troubleshoot network issues, and perform various system administration tasks using just a web browser. In this tutorial, we will guide you through the installation and usage of Cockpit on Ubuntu 22.04.
Prerequisites
Before we begin, make sure you have the following:
- A server running Ubuntu 22.04
- A configured root password on the server
Installing Cockpit on Ubuntu 22.04
Installing Cockpit on Ubuntu 22.04 is a breeze. Follow the steps below:
- Update your system’s package list by running the command
sudo apt update
. - Once the update is complete, install Cockpit by running the command
sudo apt install cockpit -y
. - After the installation is finished, install the Podman module by running the command
sudo apt install cockpit-podman -y
. - Now, start the Cockpit service with the command
sudo systemctl start cockpit
. - To ensure that Cockpit starts automatically at system reboot, enable it with the command
sudo systemctl enable cockpit
. - To verify the status of the Cockpit service, run the command
sudo systemctl status cockpit
. You should see an output similar to the following:
? cockpit.service- Cockpit Web Service Loaded:loaded(/lib/systemd/system/cockpit.service;static) Active:active(running) since Mon2022-12-0515:15:24UTC; 8s ago Docs: man:cockpit-ws(8) MainPID:16176(cockpit-tls) Tasks:1(limit:4579) Memory:956.0K CPU: 363ms CGroup:/system.slice/cockpit.service ??16176/usr/lib/cockpit/cockpit-tls Dec0515:15:24 ubuntu2204 systemd[1]: Starting Cockpit Web Service... Dec0515:15:24 ubuntu2204 cockpit-certificate-ensure[16168]:/usr/lib/cockpit/cockpit-certificate-helper: line32: sscg: command not found Dec0515:15:24 ubuntu2204 cockpit-certificate-ensure[16169]:..+...+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*....> Dec0515:15:24 ubuntu2204 cockpit-certificate-ensure[16169]:...+...........+...+..........+..+...+.+.....+.......+..+.+..+....+.........+..> Dec0515:15:24 ubuntu2204 cockpit-certificate-ensure[16169]:----- Dec0515:15:24 ubuntu2204 systemd[1]: Started Cockpit Web Service.
Congratulations! You have successfully installed Cockpit on Ubuntu 22.04. Cockpit is now running and listening on port 9090. To check if the service is active, use the command sudo ss -antpl | grep 9090
. You should see output similar to the following:
LISTEN 0 4096 *:9090 *:* users:(("cockpit-tls",pid=16176,fd=3),("systemd",pid=1,fd=61))
Configuring UFW Firewall
If you have the UFW firewall installed and configured on your system, you need to allow ports 80 and 9090 through the firewall to access Cockpit. Follow these steps:
- Allow ports 80 and 9090 using the command
sudo ufw allow 80 && sudo ufw allow 9090
. - Reload the UFW firewall with the command
sudo ufw reload
. - To check the status of the UFW firewall rules, use the command
sudo ufw status
. The output should resemble the following:
Status: active To Action From ------------ 22ALLOW Anywhere 80ALLOW Anywhere 9090ALLOW Anywhere 22(v6)ALLOWAnywhere(v6) 80(v6)ALLOWAnywhere(v6) 9090(v6)ALLOWAnywhere(v6)
Accessing the Cockpit Web Interface
Now that Cockpit is installed and configured, you can access the web interface to manage your Ubuntu 22.04 server. Follow these steps:
- Open your web browser and enter the URL
https://your-server-ip:9090
. Replaceyour-server-ip
with the actual IP address of your server. - You will be greeted with the Cockpit login page. Enter your root username and password, then click on “Login”.
- After successful authentication, you will be redirected to the Cockpit dashboard, where you can access various management features.
Exploring Cockpit’s Features
Cockpit offers a range of features to help you monitor and administer your Ubuntu 22.04 server. Let’s take a closer look at some of these features:
Storage
In the left pane of the Cockpit dashboard, click on “Storage” to view information about your system’s partitions. This includes details such as the filesystem type, total size, and used space.
Networking
Clicking on “Networking” will display network-related information, such as IP addresses, network interfaces, and DNS settings. This feature is useful for troubleshooting network issues or configuring network settings.
Podman Containers
If you’re using Podman to manage containers on your server, Cockpit provides a dedicated section for managing and monitoring your containers and images. Click on “Podman Containers” to view an overview of your containers and their status.
Services
The “Services” section allows you to manage system services running on your Ubuntu 22.04 server. You can start, stop, enable, or disable services as needed. This feature is particularly useful for managing background services or daemons.
Applications
Cockpit also provides an “Applications” section where you can view and manage the applications installed on your server. This includes both system-level and user-level applications. You can start, stop, or restart applications directly from the Cockpit interface.
Terminal
For advanced users who prefer the command-line interface, Cockpit offers a built-in terminal feature. Click on “Terminal” to open a terminal session and execute commands directly on your Ubuntu 22.04 server.
Conclusion
By following this tutorial, you have successfully installed Cockpit on your Ubuntu 22.04 server. Cockpit provides a user-friendly web-based interface for managing and configuring various aspects of your Linux server. With its intuitive design and powerful features, Cockpit is an excellent choice for both beginners and experienced administrators alike.
If you’re looking for reliable cloud hosting solutions, Shape.host offers SSD Linux VPS services that provide efficient, scalable, and secure hosting for your applications. With Shape.host, you can focus on your business while leaving the server management to the experts. Visit Shape.host to learn more about their services.
Feel free to reach out if you have any questions or need further assistance. Happy server administration with Cockpit!