Cockpit is a web-based server management tool that provides an easy way to monitor and administer your Linux servers. It allows you to manage multiple servers from a single web interface, and provides a range of features and tools for managing and configuring your servers. In this tutorial, we will show you how to install Cockpit on Rocky Linux 8.
Prerequisites
Before getting started, make sure you have a clean installation of Rocky Linux 8 and that you are logged in as a user with sudo privileges. You will also need to have the dnf
package manager installed on your system.
To check if dnf
is installed, you can use the following command:
dnf --version
If dnf
is not installed, you can install it by running the following command:
sudo dnf install dnf
Once dnf
is installed, you are ready to proceed with installing Cockpit.
Step 1: Enable the Cockpit package repository
To install Cockpit on Rocky Linux 8, we will add the Cockpit package repository to our system and install the Cockpit package from the repository.
To add the Cockpit package repository, open a terminal and run the following command:
sudo dnf config-manager --add-repo=https://copr.fedorainfracloud.org/coprs/g/cockpit/cockpit-preview/repo/rhel8/g-cockpit-cockpit-preview-rhel8.repo
This will add the Cockpit package repository to the /etc/yum.repos.d/
directory on your system.
Once the package repository has been added, update the list of available packages by running the following command:
sudo dnf update
Step 2: Install Cockpit
Now that the Cockpit package repository is available, we can install the Cockpit package. To install Cockpit, run the following command:
sudo dnf install cockpit
This will download and install the Cockpit package and all of its dependencies. The installation process may take a few minutes to complete.
Once the installation is finished, you can verify that Cockpit is installed and working by running the following command:
systemctl status cockpit
This will show the status of the Cockpit service, including whether it is running and enabled.
Step 3: Enable and start Cockpit
To use Cockpit, you will need to enable and start the Cockpit service. To do this, run the following commands:
sudo systemctl enable cockpit
sudo systemctl start cockpit
The first command will enable the Cockpit service to start automatically on boot. The second command will start the Cockpit service.
Once the Cockpit service is running, you can access the Cockpit web interface by visiting the following URL in your web browser:
http://<your-server-ip>:9090
Replace <your-server-ip>
with the IP address of your Rocky Linux 8 server.
This will open the Cockpit login page.
Step 4: Log in to Cockpit
To log in to Cockpit, you will need to use a user account that has sudo
privileges. Enter the username and password for a sudo
user, and click the “Log in” button to log in to Cockpit.
Once you have logged in to Cockpit, you will see the Cockpit dashboard, which provides an overview of your server and its resources. From here, you can view and manage various aspects of your server, such as the system information, services, logs, network, and storage.
Conclusion
In this tutorial, you learned how to install and use Cockpit on Rocky Linux 8. You learned how to add the Cockpit package repository, install the Cockpit package, enable and start the Cockpit service, and log in to the Cockpit web interface. With Cockpit installed and configured, you can start managing and administering your Rocky Linux 8 server from a web-based interface.