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.
Before starting this tutorial, ensure that you have the following:
Graylog uses MongoDB as a data store for log data. To install MongoDB on Arch Linux, follow these steps:
Update the system package cache:
sudo pacman -Sy
Install MongoDB:
sudo pacman -S mongodb
Once installed, start the MongoDB service and enable it to start on boot:
sudo systemctl start mongodb
sudo systemctl enable mongodb
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.
Graylog also uses Elasticsearch as a search engine for log data. To install Elasticsearch on Arch Linux, follow these steps:
Add the Elasticsearch package signing key:
sudo pacman-key --keyserver hkp://pgp.mit.edu --recv-keys 46095ACC8548582C1A2699A9D27D666CD88E42B4
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
Update the system package cache:
sudo pacman -Sy
Install Elasticsearch:
sudo pacman -S elasticsearch-oss
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
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.
Now that we have installed MongoDB and Elasticsearch, we can proceed to install Graylog. Follow these steps:
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
Update the system package cache:
sudo pacman -Sy
Install Graylog:
sudo pacman -S graylog-server
By default, Graylog listens on port 9000. To configure Graylog, follow these steps:
Open the Graylog configuration file:
sudo nano /etc/graylog/server/server.conf
Find the following lines:
# web_listen_uri = http://127.0.0.1:9000/
# rest_listen_uri = http://127.0.0.1:9000/api/
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/
Save and close the file.
Now that we have configured Graylog, we can start the service by running the following command:
sudo systemctl start graylog-server
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.
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!