Managing Linux servers can sometimes be challenging, especially for those who prefer a graphical interface. Cockpit is a powerful web-based tool that simplifies server management by providing an intuitive dashboard. In this guide, we'll walk you through the process of installing and using Cockpit on Debian/Ubuntu.
Why Use Cockpit?
Cockpit offers several advantages, including:
- A web-based GUI for server management.
- Remote access and control of system services.
- Monitoring of system performance and logs.
- User management and storage configuration.
- Easy management of multiple servers.
Step 1: Update Your System
Before installing any package, it's a good practice to update your system. Run the following command:
sudo apt update && sudo apt upgrade -y
Step 2: Install Cockpit
Cockpit is available in the default Debian/Ubuntu repositories. Install it with:
sudo apt install cockpit -y
This will install the core Cockpit system along with its dependencies.
Step 3: Enable and Start Cockpit
Once installed, enable and start the Cockpit service:
sudo systemctl enable --now cockpit.socket
To verify that Cockpit is running, use:
sudo systemctl status cockpit.socket
Step 4: Configure Firewall (If Needed)
If your server has a firewall enabled, allow traffic on port 9090, which Cockpit uses:
For UFW:
sudo ufw allow 9090/tcp
sudo ufw reload
For Firewalld:
sudo firewall-cmd --add-service=cockpit --permanent
sudo firewall-cmd --reload
Step 5: Access Cockpit Web Interface
Now, open your web browser and navigate to:
https://<your-server-ip>:9090
You may encounter a security warning since Cockpit uses a self-signed SSL certificate. Simply accept the warning and proceed.
Log in using your root or regular user credentials.
Step 6: Install Additional Modules (Optional)
Cockpit can be extended with additional modules to manage specific system components:
sudo apt install cockpit-storaged cockpit-networkmanager cockpit-packagekit -y
These modules allow for storage management, network configuration, and package updates through Cockpit’s web interface.