Cockpit is an open-source web-based graphical interface that provides system administrators and users with an easy way to manage and monitor Linux servers and desktops. The Cockpit Web Console enables you to perform administrative tasks without the need for deep command-line knowledge, making it user-friendly and accessible for both beginners and advanced users.
Cockpit is commonly used for monitoring system performance, managing services, administering storage and networks, and configuring users and security settings. It is particularly useful on servers but can also be installed on desktops.
Key Features of Cockpit:
- Web-Based Interface:
- Cockpit provides a web-based interface that is accessible through a browser. This allows you to manage your server remotely without needing to use SSH for every task.
- Real-Time Monitoring:
- Cockpit offers real-time system monitoring for CPU usage, memory usage, disk activity, network traffic, and other system performance metrics. This gives you a clear overview of your system’s health.
- Multi-Server Management:
- Cockpit allows you to manage multiple servers from a single dashboard. You can easily connect to additional servers and manage them all from the same interface.
- Service Management:
- You can start, stop, enable, or disable services directly from the Cockpit interface. It also allows you to manage systemd services, providing a visual interface for system management.
- Log Monitoring:
- Cockpit includes a log viewer that allows you to inspect system logs and journal logs, making it easier to troubleshoot issues without accessing the terminal.
- Storage and Disk Management:
- Cockpit provides a visual interface for managing partitions, disk usage, logical volumes, and RAID configurations. You can create, resize, and format storage volumes directly from the web console.
- Networking Management:
- Cockpit allows you to configure network interfaces, manage network bonds, bridges, and VLANs, and monitor network traffic. It also includes tools to manage firewall settings.
- Docker and Podman Integration:
- Cockpit supports Docker and Podman containers. You can manage and monitor containers, view logs, start and stop containers, and even launch new containers directly from the web interface.
- User and Group Management:
- You can manage users, groups, and roles, including password policies and SSH key setups. This is particularly useful for managing user access to the server.
- Software Updates:
- Cockpit can manage system updates, allowing you to check for new packages, review available updates, and install them, all from the web console.
- Terminal Access:
- Cockpit includes a built-in terminal, which allows advanced users to run command-line tasks without leaving the web interface.
- Security and Firewall:
- Cockpit provides tools for managing firewall rules (via firewalld), and you can view system security policies. It also supports integration with SSO (Single Sign-On) for improved security and user authentication.
- Graphical Console for Virtual Machines (VMs):
- Cockpit can manage KVM/QEMU virtual machines, providing a graphical console to create, start, stop, and manage VMs. This is particularly useful for servers running virtualization tasks.
- Modular and Extensible:
- Cockpit’s design is modular, allowing you to install additional plugins to extend its capabilities. There are many extensions for managing specific services, such as SELinux, OpenShift, and Kubernetes.
Use Cases of Cockpit:
- System Monitoring:
- System administrators can use Cockpit to monitor server performance in real time, check resource usage, and detect bottlenecks.
- Server Management:
- Cockpit simplifies the management of a Linux server by providing an easy interface for handling system tasks such as storage management, service management, user management, and more.
- Multi-Server Environments:
- For administrators managing multiple servers, Cockpit allows you to link multiple Linux machines to one central interface for easier administration.
- Beginner-Friendly Server Administration:
- Cockpit is highly beneficial for users who are new to Linux server management. It reduces the need to learn command-line syntax for basic administrative tasks, while still offering powerful features.
- Virtual Machine Management:
- For servers running KVM virtualization, Cockpit provides a simplified interface for managing VMs, allowing you to start, stop, and create new VMs without needing a separate tool.
- Container Management:
- Administrators managing containers with Docker or Podman can use Cockpit to control container operations from a web interface, making it ideal for containerized environments.
- Security and User Management:
- Cockpit allows for easy user and security management, giving you control over user roles, password policies, SSH access, and firewall settings, all in one place.
Pros of Using Cockpit:
- Easy to Use: Intuitive web-based interface suitable for both beginners and experienced administrators.
- Real-Time Monitoring: Provides real-time performance and log monitoring, which can be crucial for system health tracking.
- Remote Management: Access and manage your server from anywhere using a web browser.
- Multi-Server Support: Manage multiple servers through a single Cockpit interface.
- Modular: Easily extensible with additional plugins for services like Docker, Podman, SELinux, and more.
- Terminal Access: Built-in terminal for running commands without leaving the Cockpit interface.
- Open Source: Free and actively maintained by the open-source community.
Cons of Using Cockpit:
- Limited Advanced Features: For highly complex systems, Cockpit may not replace more advanced management tools.
- No Built-in Alerting: Cockpit is great for monitoring but lacks advanced alerting features out of the box (though this can be extended with other tools).
- Requires Installation: While easy to set up, it still requires installation and configuration on each server.
Let me know if you need further details!
Step 1: Create an Instance
- Access the Dashboard: Log in to your Shape.Host account and navigate to your Dashboard.
- Click Create: Click on the “Create” button located in the top-right corner.
- Select Instances: From the dropdown menu, choose “Instances” to begin creating a new cloud server.
- Select Location: Choose a data center location for your instance closest to your target audience for optimal performance.
- Choose a Plan: Scroll through the available pricing plans. Select a plan based on your project requirements, such as Standard, CPU-Optimized, or Memory-Optimized.
- Choose an Image: Select Debian 12 as the operating system for your instance.
- Authentication and Finalize: Choose your authentication method, either via SSH keys or password. Once done, click Create Instance to launch your server.
Step 2: Access Your Cockpit Instance
To connect to your instance on Shape.Host, follow these steps:
- Get the Instance IP: After creating your instance, find the public IP address in the Shape.Host dashboard under Resources.
- Open SSH Client: Use an SSH client like Terminal (Linux/macOS) or PuTTY (Windows).
- SSH into the Instance: Run the following command in your terminal:
ssh root@<your-instance-ip>
Replace <your-instance-ip>
with your actual instance IP address.
- Enter the Password: If prompted, enter your instance’s root password or use your SSH key if configured.
You are now connected to your instance!
Step 3: Update System Packages
Start by updating the system’s package index to ensure all software is up-to-date:
apt update
Step 4: Install Cockpit
Install Cockpit using the following command:
apt install cockpit -y
Step 5: Start Cockpit Service
Start the Cockpit service and ensure it’s running:
systemctl start --now cockpit
Verify that Cockpit is enabled to start on boot:
systemctl is-enabled cockpit
Check the status of the Cockpit service:
systemctl status cockpit
Step 6: Check Listening Ports
Verify that Cockpit is listening on the appropriate ports:
ss -tulpn
Step 7: Configure UFW Firewall
Install UFW to manage firewall rules:
apt install ufw
Allow OpenSSH and Cockpit’s default port (9090) through the firewall:
ufw allow OpenSSH
ufw allow 9090/tcp
ufw enable
ufw status
Step 8: Access Cockpit Web Console
Launch your web browser and visit your server’s IP address with the HTTPS protocol followed by port 9090 (e.g., https://<your-ip>:9090/
). If the Cockpit installation is successful, you will see the Cockpit login page.
Once logged in, you will see the cockpit dashboard like the following. As you can see, we also have a Limited access mode.
Click on the button Turn on administrative access and you will be prompted for password. Input your password and click Authenticate. This action is similar to the ‘sudo su‘ command when you need root privileges.
Once the authentication is successful, you will see the confirmation of Administrative access at the top menu. This means you have the privilege to do anything in cockpit.
This tutorial was made possible using Shape.Host services, specifically their Cloud VPS offering. Shape.Host provides reliable and scalable cloud hosting solutions that are ideal for hosting applications like Cockpit. Check out their Cloud VPS plans to get started with your own instance today.