Skip to main content

Awesome Cockpit 🚀

· 3 min read
Max Kaido
Architect

Cockpit is a web-based graphical interface for servers, making Linux server administration more accessible through a modern web browser.

🌟 Top 10 Cool Use Cases

  1. Multi-Server Dashboard

    • Monitor multiple servers from a single interface
    • Real-time resource usage and system status
    • Quick access to all managed machines
  2. Container Management

    • Pull, run, and manage Docker containers
    • Monitor container resources and logs
    • Easy Podman integration for rootless containers
  3. Storage Management

    • Create and manage LVM volumes
    • Monitor disk usage and health
    • Format and mount new drives on the fly
  4. Service Control Center

    • Start/stop/restart systemd services
    • Monitor service logs in real-time
    • Enable/disable services on boot
  5. Network Management

    • Configure network interfaces
    • Manage firewall rules
    • Monitor network traffic and connections
  6. Terminal Access

    • Browser-based terminal access
    • Multiple terminal sessions
    • Copy-paste support between local and remote
  7. Performance Monitoring

    • CPU, Memory, Disk I/O graphs
    • Process monitoring and management
    • Resource usage alerts
  8. User Management

    • Create and manage user accounts
    • SSH key management
    • Group permissions control
  9. Software Updates

    • System updates management
    • Package installation/removal
    • Update history tracking
  10. Log Analysis

    • Centralized log viewer
    • Real-time log monitoring
    • Log search and filtering

🛠 Key Features

  • Zero Dependencies: Just install and go
  • Responsive Design: Works on mobile devices
  • Role-Based Access: Fine-grained access control
  • API Access: RESTful API for automation
  • SSL Support: Secure communication out of the box
  • Multi-Language: Supports multiple languages
  • Plugin System: Extensible with additional modules
  • SELinux Integration: Works with security policies
  • Active Directory: Enterprise authentication support
  • Metrics History: Historical performance data

🚀 Getting Started

On Ubuntu/Debian:

```bash sudo apt install cockpit sudo systemctl enable --now cockpit.socket ```

On RHEL/CentOS/Fedora:

```bash sudo dnf install cockpit sudo systemctl enable --now cockpit.socket ```

Access Cockpit:

💻 Using Cockpit for Personal Machines

Desktop Setup

  1. Install Cockpit package
  2. Enable HTTPS access (optional): ```bash sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048
    -keyout /etc/cockpit/ws-certs.d/0-self-signed.key
    -out /etc/cockpit/ws-certs.d/0-self-signed.crt ```
  3. Configure firewall: ```bash sudo firewall-cmd --add-service=cockpit --permanent sudo firewall-cmd --reload ```

Laptop Configuration

  1. Install and enable: ```bash sudo apt install cockpit sudo systemctl enable --now cockpit.socket ```
  2. Set up dynamic DNS (optional)
  3. Configure port forwarding if behind NAT

VPS Integration

  1. Install Cockpit
  2. Secure with SSL certificate (Let's Encrypt recommended)
  3. Set up authentication: ```bash sudo cockpit-ws --port=9090 --no-tls ```
  4. Configure SSH key authentication

🔄 Alternatives

Web-Based Alternatives

  • Webmin: More traditional interface, extensive module system
  • Ajenti: Modern Python-based panel
  • Portainer: Container-focused management
  • Pterodactyl: Game server management panel

Self-Hosted Dashboards

  • Grafana: Advanced metrics and monitoring
  • Netdata: Real-time performance monitoring
  • Zabbix: Enterprise monitoring solution
  • Prometheus + Grafana: Metrics collection and visualization

🛡️ Security Tips

  1. Always use HTTPS
  2. Enable 2FA when possible
  3. Use strong passwords
  4. Regularly update Cockpit
  5. Monitor access logs
  6. Use custom ports
  7. Implement IP whitelisting
  8. Keep system updated
  9. Use SSH keys instead of passwords
  10. Regular security audits

🎯 Best Practices

  1. Regular backups of Cockpit configuration
  2. Monitor resource usage
  3. Use separate admin accounts
  4. Document custom configurations
  5. Test updates in staging
  6. Set up monitoring alerts
  7. Use configuration management
  8. Regular log rotation
  9. Network segmentation
  10. Performance benchmarking