Your web hosting partners since 2004.
Buy now »

FAQ » VPS

How do I install Cockpit on CentOS 7?

Cockpit is a free and open source program for Linux server management. It is very lightweight and has a beautiful, easy to use web interface. It allows system administrators to easily perform tasks such as starting Docker containers, storage administration, and network configuration.

In this tutorial you will learn how to install the latest version of Cockpit on CentOS 7.

Install Cockpit

We can install the software from the default CentOS repository using the following command.

sudo yum -y install cockpit

Once you have installed Cockpit, start and enable it using the following commands.

sudo systemctl enable --now cockpit.socket

Configure firewall

Run the following commands to allow all of the required ports through the firewall.

sudo firewall-cmd --permanent --zone=public --add-service=cockpit
sudo firewall-cmd --reload

The installation of Cockpit is now complete, you can access the dashboard by navigating to the following URL.

  • http://<your-server>:9090

You may be prompted with a security warning about the SSL certificate of the site as it is self-signed, but you can ignore the warning and proceed to login area. Log into Cockpit using the root credentials of your VPS.

Installing new SSL certs

In order to use SSL certificates you need to combine them into one file in the following location with the cert file ending in .cert. The public key should be first, then the private.

ls /etc/cockpit/ws-certs.d

It should look something like this.

cat /etc/cockpit/ws-certs.d/ssl.cert

-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----

Troubleshooting

Authorization not available. Check if polkit service is running

Problem

# systemctl start cockpit
Authorization not available. Check if polkit service is running or see debug message for more information.
Failed to start cockpit.service: Connection timed out

Solution

sudo yum -y install setroubleshoot setools

Last updated: 2017-05-01

« Go Back

Order now »

A quick response, have used for several years. Support services are good.