Install and Enable Cockpit

The cockpit package is, by default, included in all non-minimal Oracle Linux software installations.

What Do You Need?

  • A system with Oracle Linux installed.
  • Root administrator privileges on the host Linux system.

    Note:

    The steps in this procedure uses the sudo command to run commands as the root user.

Steps

Using the Cockpit Terminal window, perform the following steps to install and enable the cockpit package on an Oracle Linux machine.

  1. To verify the version of the cockpit package that's available for installation, type:
    sudo dnf info cockpit
    The versioning information and other information describing the cockpit package appears in the command line output.
  2. To install the Cockpit package on the Oracle Linux host system, type:
    sudo dnf install cockpit
  3. To enable the systemd socket service and automatically start it upon a system restart, type:
    sudo systemctl enable --now cockpit.socket

    The socket web service, by default, is configured to accept connections on TCP port 9090.

  4. To verify that the socket web service is enabled for Cockpit, type:
    sudo systemctl status cockpit.socket
    An Active status and the default listening port of 9090 appears in the command line output to indicate the service is enabled.
  5. (Optional) If a firewall is enabled, perform the following to enable the Cockpit service to receive inbound connections.
    1. Open the firewall for the cockpit service as follows:
      sudo firewall-cmd --add-service=cockpit --permanent
    2. Apply the firewall configuration change in the runtime environment by reloading the firewall configuration as follows:
      sudo firewall-cmd --reload

    Note:

    The firewall restricts access to the cockpit system. Remote authorized users can access the system securely by using port forwarding over SSH. For example, the user can type the following command from the user's local system:

    ssh -L 9090:localhost:9090 user@cockpit-system

    The cockpit-system can be the system's fully qualified domain name (FQDN), such as myserver.example.com or the system's IP address. Then the user can log in to localhost, as explained in Log in to the Cockpit Web Console.