Install Cockpit and Firewalld on Debian 12
Install Cockpit, Firewalld, and Open Ports on Debian 12
1. Update the System
sudo apt update
sudo apt upgrade -y
2. Install Cockpit
sudo apt install -y cockpit
3. Enable and Start Cockpit
sudo systemctl enable --now cockpit.socket
4. Install firewalld
sudo apt install -y firewalld
sudo systemctl enable --now firewalld
sudo install cockpit-machines cockpit-pcp network-manager cockpit-networkmanager -y
Note: If you previously used another firewall (like UFW), remove it first:
sudo apt remove --purge ufw
5. Open Required Ports in firewalld
- SSH (port 22): For remote access
- HTTP (port 80): For web traffic
- HTTPS (port 443): For secure web traffic
- Cockpit (port 9090): For Cockpit web UI
- Webmin (port 12321): For Webmin web UI (on Turnkey images, default is port 1000)
sudo firewall-cmd --zone=public --add-service=ssh --permanent
sudo firewall-cmd --zone=public --add-service=http --permanent
sudo firewall-cmd --zone=public --add-service=https --permanent
sudo firewall-cmd --zone=public --add-service=cockpit --permanent
sudo firewall-cmd --zone=public --add-port=12321/tcp --permanent
sudo firewall-cmd --reload
6. Verify firewalld Rules
sudo firewall-cmd --list-all
7. Access Cockpit and Webmin
- Cockpit:
https://your-server-ip:9090
- Webmin:
https://your-server-ip:12321
References
- Official Cockpit documentation: cockpit-project.org
- HowtoForge: Install Cockpit Web Console on Debian 12
- edafe.de: Install Cockpit on Debian 12 bookworm
- Webmin Firewall: webmin.com/firewall.html
No Comments