How To Install Graylog on CentOS 8

Install Graylog on CentOS 8

In this tutorial we will show you how to install Graylog on CentOS 8. For those of you who didn’t know, Graylog is an open-source log management system that allows System Administrators/Developers to aggregate up to terabytes of log data, from multiple log sources management tool based on Elasticsearch and MongoDB. Graylog helps you to collect, index and analyze any machine logs centrally.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Graylog on a CentOS 8 server.

Install Graylog on CentOS 8

Step 1. First let’s start by ensuring your system is up-to-date.

Step 2. Installing Java.

Elasticsearch requires Java to be installed on the system. So, install either OpenJDK or Oracle JDK using the following command:

Check if it is successfully installed:

Step 3. Installing Elasticsearch.

First, import the GPG signing key before the installation:

Now, we Add Elasticsearch repository:

Then, install Elasticsearch using the follwing command:

Step 4. Configuring Elasticsearch for Graylog.

You need to modify the Elasticsearch configuration file and set the cluster name to graylog:

Change the file as shown below:

Reload the systemctl daemon and enable Elasticsearch to start automatically on the system startup:

Check the health of the Elasticsearch with the following command:

Step 5. Installing MongoDB.

MongoDB is not available in the default CentOS repository. You will need to add the MongoDB repo first:

Install MongoDB by running the following command:

Start the MongoDB service and enable it to start on boot with the following command:

Step 6. Installing Graylog CentOS 8.

Now install the Graylog repository configuration:

Install Graylog server using dnf:

After you have installed the Graylog Server, you have to generate secret key for Graylog using the following command:


Next, create a hash password for the root user that can be used to log in to the Graylog web server using the following command:


Then, edit the server.conf file to begin the Graylog configuration:

Make changes to the file as shown below:

Step 7. Configure Graylog web interface.

Enable the Graylog web interface by editing the server.conf file:

After you have modified the configuration file, restart Graylog service:

Step 8. Accessing Graylog.

Graylog will be available on HTTP port 9000 by default. Open your favorite browser and navigate to or http://your-server-ip:9000/ and complete the required the steps to finish the installation. Log in with username admin and the password you configured at root_password_sha2 on server.conf.

Install Graylog on CentOS 8

Congratulation’s! You have successfully installed Graylog. Thanks for using this tutorial for installing Graylog in CentOS 8 system. For additional help or useful information, we recommend you to check the official Graylog website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!