How to Install Graylog on Arch Linux

Graylog is an open-source log management platform that enables you to collect, index, and analyze log data from various sources. It provides a user-friendly web interface for searching and analyzing logs, making it an excellent tool for system administrators and developers. In this tutorial, we will go through the steps required to install Graylog on Arch Linux.

Prerequisites

Before starting this tutorial, ensure that you have the following:

Step 1: Install MongoDB

Graylog uses MongoDB as a data store for log data. To install MongoDB on Arch Linux, follow these steps:

  1. Update the system package cache:

    sudo pacman -Sy 
    
  2. Install MongoDB:

    sudo pacman -S mongodb 
    
  3. Once installed, start the MongoDB service and enable it to start on boot:

    sudo systemctl start mongodb 
    sudo systemctl enable mongodb 
    
  4. Verify that the service is running correctly:

    sudo systemctl status mongodb 
    

    If the service is running correctly, you should see a message indicating that it is active.

Step 2: Install Elasticsearch

Graylog also uses Elasticsearch as a search engine for log data. To install Elasticsearch on Arch Linux, follow these steps:

  1. Add the Elasticsearch package signing key:

    sudo pacman-key --keyserver hkp://pgp.mit.edu --recv-keys 46095ACC8548582C1A2699A9D27D666CD88E42B4 
    
  2. Add the Elasticsearch repository to your system:

    echo -e "[elasticsearch]\nServer = https://artifacts.elastic.co/packages/oss-6.x/yum" | sudo tee /etc/pacman.conf.d/elastic.repo 
    
  3. Update the system package cache:

    sudo pacman -Sy 
    
  4. Install Elasticsearch:

    sudo pacman -S elasticsearch-oss 
    
  5. Once installed, start the Elasticsearch service and enable it to start on boot:

    sudo sysctl -w vm.max_map_count=262144 
    sudo systemctl start elasticsearch 
    sudo systemctl enable elasticsearch 
    
  6. Verify that the service is running correctly:

    sudo systemctl status elasticsearch 
    

    If the service is running correctly, you should see a message indicating that it is active.

Step 3: Install Graylog

Now that we have installed MongoDB and Elasticsearch, we can proceed to install Graylog. Follow these steps:

  1. Add the Graylog repository to your system:

    echo -e "[graylog]\nServer = https://packages.graylog2.org/repo/packages/graylog-3.3-repository_latest.rpm" | sudo tee /etc/pacman.conf.d/graylog.repo 
    
  2. Update the system package cache:

    sudo pacman -Sy 
    
  3. Install Graylog:

    sudo pacman -S graylog-server 
    

Step 4: Configure Graylog

By default, Graylog listens on port 9000. To configure Graylog, follow these steps:

  1. Open the Graylog configuration file:

    sudo nano /etc/graylog/server/server.conf 
    
  2. Find the following lines:

    # web_listen_uri = http://127.0.0.1:9000/
    # rest_listen_uri = http://127.0.0.1:9000/api/ 
    
  3. Uncomment these lines and replace "127.0.0.1" with the IP address of your server.

    web_listen_uri = http://<your_server_ip>:9000/
    rest_listen_uri = http://<your_server_ip>:9000/api/ 
    
  4. Save and close the file.

Step 5: Start Graylog

Now that we have configured Graylog, we can start the service by running the following command:

sudo systemctl start graylog-server 

Step 6: Access Graylog

To access the Graylog web interface, open a web browser and navigate to the following URL:

http://<your_server_ip>:9000/ 

You should see the Graylog login page. Enter the default username "admin" and password "admin" to log in.

Conclusion

In this tutorial, we have learned how to install Graylog on Arch Linux. Once installed, Graylog allows us to collect, analyze, and search log data from various sources, making it an essential tool for system administrators and developers.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!