Install Cockpit for Web-Based VPS Management

Install Cockpit for Web-Based VPS Management

July 2026 · 7 min read

Cockpit is a web-based management interface for Linux servers that simplifies VPS administration through a graphical browser interface instead of command-line-only management. Monitor CPU, memory, and disk usage in real time, start and stop services, manage user accounts, configure firewall rules, and access a web terminal—all from one dashboard. Cockpit also supports multi-server management, allowing you to monitor and administer multiple VPS instances from a single console while maintaining robust security with authentication and encrypted connections.

Install Cockpit on Ubuntu

sudo apt update
sudo apt install cockpit -y

# Start the Cockpit service
sudo systemctl start cockpit.socket
sudo systemctl enable cockpit.socket

Open Firewall Port 9090

# Check if UFW firewall is active
sudo ufw status

# If firewall is enabled, open port 9090
sudo ufw allow 9090/tcp
sudo ufw reload

# Verify the rule was added
sudo ufw status | grep 9090

Access Cockpit Web Interface

Once installed, open your browser and navigate to:

https://your-vps-ip:9090

Or if you've configured a domain:

https://your-server-domain:9090

Log in using any Linux user account with sudo privileges, or the root user if preferred.

Tip: Cockpit uses a self-signed SSL certificate by default. Your browser will display a security warning. Click "Advanced" and "Proceed Anyway"—this is safe since Cockpit runs locally and doesn't require a trusted certificate for security.

Key Cockpit Modules for VPS Management

System: Real-time monitoring of CPU, memory, disk, and network usage with historical graphs and system logs.

Services: Start, stop, restart, or reload systemd services like Nginx, MySQL, PHP-FPM, and PostgreSQL with a single click.

Users and Groups: Create, delete, and modify Linux user accounts and group memberships without touching the terminal.

Networking: View and configure network interfaces, IP addresses, DNS settings, and firewall rules visually.

Terminal: Web-based terminal that functions as a secure SSH alternative for executing commands directly in the browser.

Software Updates: Check for available updates and apply security patches automatically or on demand.


Verify That Cockpit Is Working Correctly

# Check Cockpit service status
sudo systemctl status cockpit.socket

# Verify port 9090 is listening
sudo ss -tlnp | grep 9090

# Test HTTPS connectivity
curl -k https://localhost:9090 -I

# View recent Cockpit logs
sudo journalctl -u cockpit.socket -n 20
Tip: If you see status "active (running)" and port 9090 listed in the output, Cockpit is properly installed and ready to use.

Common Issues & Troubleshooting

Cannot connect to port 9090

The firewall may be blocking the port, or the Cockpit service hasn't started:

# Restart the Cockpit service
sudo systemctl restart cockpit.socket

# Check service status
sudo systemctl status cockpit.socket

# If using a firewall, ensure port 9090 is open
sudo ufw allow 9090/tcp
sudo ufw reload

Error: "Unable to authenticate" when logging in

The username or password is incorrect, or the user lacks sufficient permissions:

# Ensure the user has sudo privileges
sudo usermod -aG sudo username

# Log out and log back in from the web interface
# Refresh the browser and try again

SSL certificate warning: NET::ERR_CERT_AUTHORITY_INVALID

This is normal for a fresh Cockpit installation. The browser sees the self-signed certificate as untrusted:

# Cockpit stores its certificate at
ls -la /etc/cockpit/ws-certs.d/

# To use a trusted certificate (optional), place your cert and key in /etc/cockpit/ws-certs.d/
# Then restart Cockpit
sudo systemctl restart cockpit.socket

Cockpit is consuming too much CPU or memory

Cockpit is lightweight — cockpit-ws sits idle when nobody has a page open. Unusually high resource usage is usually a leftover session or a browser tab still polling in the background:

# Check running cockpit processes
ps aux | grep cockpit

# Close any lingering sessions (log out of every open Cockpit tab)
sudo systemctl restart cockpit.socket

Web interface is slow or unresponsive

Network latency or resource contention may cause sluggish performance. Diagnose with:

# Check current CPU and memory usage
top

# Test network latency
ping localhost

# If CPU and memory are low, another service may be consuming resources

Frequently Asked Questions

Is Cockpit secure? Do I need a reverse proxy?

Cockpit uses the same PAM authentication as SSH and includes SSL/TLS encryption by default, making it as secure as SSH. It's safe to expose to the internet if you use strong passwords and disable root login. For extra security, use a firewall to restrict access to known IPs, or deploy fail2ban to prevent brute-force attacks.

Can I manage multiple servers with one Cockpit instance?

A single Cockpit dashboard cannot directly control multiple servers, but Cockpit's dashboard feature allows you to add remote servers via SSH keys and view metrics from multiple machines in one interface. You must install Cockpit on each server you want to manage.

How do I uninstall Cockpit if I no longer need it?

Uninstalling Cockpit is straightforward: run sudo apt remove cockpit or sudo apt purge cockpit to remove all configuration files. Cockpit stores minimal persistent data outside of /etc/cockpit/, so removal is safe and leaves no lingering impact on your system.