Cockpit is a web-based server administration tool for self-managed Linux servers. The free server control panel, backed by Red Hat, is unique in the sense that the graphical interface only shows settings for installed services. It is most beneficial to install Cockpit on Ubuntu if your server is primarily used for business networking:
- File sharing
- LDAP integration
- Virtual machine (VM) hosting
- RAID storage management
Cockpit simplifies tasks for advanced users already aware of which system apps are essential to their needs.
Install Cockpit on Ubuntu
- SSH into your Ubuntu server.
- Install Cockpit:
apt install cockpit
- Install a free SSL certificate for your hostname with Certbot.
- Cockpit requires the SSL certificate and private key to be located in the “/etc/cockpit/ws-certs.d” directory as .crt and .key files respectively. You can combine the cert and private key into a new file or copy the Certbot files separately. We’ll do the latter. Remember to replace “example.com” with your Cockpit domain all four times:
cp /etc/letsencrypt/live/example.com/fullchain.pem /etc/cockpit/ws-certs.d/example.com.crt && cp /etc/letsencrypt/live/example.com/privkey.pem /etc/cockpit/ws-certs.d/example.com.key
- Make the Cockpit user the owner of the new SSL files (replacing “example.com” within the command):
chown cockpit-ws:cockpit-ws /etc/cockpit/ws-certs.d/example.com.crt /etc/cockpit/ws-certs.d/example.com.key
- Ensure that Cockpit will use the correct SSL (.crt) file in the “ws-certs.d” directory:
remotectl certificate
It should display the full path to the new cert file. - Restart Cockpit to apply the SSL now:
systemctl restart cockpit
- Now, create a script to ensure the Cockpit SSL files are updated automatically when Certbot renews your SSL:
sudo nano /etc/letsencrypt/renewal-hooks/post/001-restart-cockpit.sh
- Add the following, replacing “example.com” with your Cockpit hostname, to automatically update the Cockpit SSL files and restart Cockpit afterwards:
#!/usr/bin/env bash
echo "SSL certificates renewed"
cp /etc/letsencrypt/live/example.com/fullchain.pem /etc/cockpit/ws-certs.d/example.com.crt
cp /etc/letsencrypt/live/example.com/privkey.pem /etc/cockpit/ws-certs.d/example.com.key
chown cockpit-ws:cockpit-ws /etc/cockpit/ws-certs.d/example.com.crt /etc/cockpit/ws-certs.d/example.com.key
echo "Cockpit Restarted"
systemctl restart cockpit - Save and exit the file.
- Make the script executable:
chmod +x /etc/letsencrypt/renewal-hooks/post/001-restart-cockpit.sh
- Test the Certbot renewal process:
sudo certbot renew --dry-run
You should see “Cockpit Restarted” at the end. - Ensure ports 9090 and 80 are enabled in your firewall.
Log into Cockpit
Visit your Cockpit instance in a web browser: example.com:9090.
The Cockpit Linux application integrates your system users for access. Login as an user with sudo privileges or create a sudo user to login. Check the box for “Reuse my password for privileged tasks” for sudo privileges in Cockpit.
The updates notification should be addressed immediately.
Select “Bug Fix Updates Available” to update the system. It should also clear any errors.
Select “Install All Updates,” “Restart Now,” then “Reconnect.” Alternatively, you can restart the server from your Account Management Panel (AMP). Either option may take up to five minutes to complete.
Cockpit Overview
Below is a short summary of the Cockpit Overview dashboard.
Logs: view and sort system logs according to level of urgency and time frame.
Storage: visualize disk space and bandwidth, list filesystems, and check storage logs.
Networking: manage bridges, VLANs, and other interfaces.
Accounts: configure system user credentials, roles, password rules. You can also terminate user sessions and configure SSH keys.
Services: manage system services and scheduled events (cron jobs).
Applications: list installed Cockpit applications. More are available at https://cockpit-project.org/applications.
Terminal: use a command line interface (CLI) for advanced tasks.
Select “Dashboard” from the sidebar to view stats for CPU, memory, network, and disk I/O.
You can change the Cockpit language by selecting your username and “Display Language” from the upper-right corner. System applications added after you install Cockpit on Ubuntu (e.g. Firewalld) will display respective configuration sections automatically.
What Next?
- If you haven’t already, install any necessary system services from the terminal.
- Create any regular users needed.
- Check for Cockpit applications that may suit your needs at cockpit-project.org. We recommend the file manager application – Navigator.
Experience full control over your server environment and deploy the best operating and management systems that fit your needs with our reliable Cloud VPS Hosting!