Graylog is a powerful open-source log management platform that allows you to collect, index, and analyze log data from various sources in real-time. It offers robust features for centralized log management, making it an invaluable tool for monitoring and troubleshooting systems. In this guide, we’ll walk you through the step-by-step process of installing Graylog on Ubuntu 22.04 LTS.
Prerequisites: Before starting the installation process, ensure that you have the following prerequisites:
- A server running Ubuntu 22.04 LTS with root or sudo privileges.
- Sufficient memory and disk space for running Graylog.
Commands
- sudo apt update
- sudo apt install apt-transport-https wget curl uuid-runtime ca-certificates gnupg2
- curl -sSL https://www.mongodb.org/static/pgp/server-6.0.asc -o mongoserver.asc
- gpg –no-default-keyring –keyring ./mongo_key_temp.gpg –import ./mongoserver.asc
- gpg –no-default-keyring –keyring ./mongo_key_temp.gpg –export > ./mongoserver_key.gpg
- sudo mv mongoserver_key.gpg /etc/apt/trusted.gpg.d/
- echo “deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/6.0 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
- sudo apt install mongodb-org
- sudo systemctl enable –now mongod
- sudo systemctl restart mongod.service
- sudo systemctl status mongod
- wget -qO – https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg –dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
- echo “deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/7.x/apt stable main” | sudo tee /etc/apt/sources.list.d/elastic-7.x.list
- sudo apt install elasticsearch
- sudo tee -a /etc/elasticsearch/elasticsearch.yml > /dev/null <<EOT cluster.name: graylog action.auto_create_index: false EOT
- sudo systemctl daemon-reload
- sudo systemctl enable –now elasticsearch
- sudo systemctl start elasticsearch
- sudo systemctl status elasticsearch
- wget https://packages.graylog2.org/repo/packages/graylog-5.0-repository_latest.deb
- sudo dpkg -i graylog-5.0-repository_latest.deb
- sudo apt update && sudo apt-get install graylog-server
- < /dev/urandom tr -dc A-Z-a-z-0-9 | head -c${1:-96};echo;
- sudo nano /etc/graylog/server/server.conf
- echo -n “Enter Password: ” && head -1 </dev/stdin | tr -d ‘\n’ | sha256sum | cut -d” ” -f1
- sudo systemctl daemon-reload
- sudo systemctl enable –now graylog-server
- sudo systemctl restart graylog-server
- sudo systemctl status graylog-server
Video: How to Install Graylog on Ubuntu 22.04 LTS: Step-by-Step Guide