{"id":13973,"date":"2025-01-13T18:42:21","date_gmt":"2025-01-13T13:12:21","guid":{"rendered":"https:\/\/www.skynats.com\/?p=13973"},"modified":"2025-01-13T18:42:22","modified_gmt":"2025-01-13T13:12:22","slug":"how-to-install-graylog-on-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/how-to-install-graylog-on-ubuntu-24-04\/","title":{"rendered":"How to Install Graylog on Ubuntu 24.04\u00a0"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Graylog is a powerful open-source log management platform that provides real-time insights into your infrastructure&#8217;s performance and health. By enabling the collection, indexing, and analysis of log data from various sources, <a href=\"https:\/\/graylog.org\/\" target=\"_blank\" rel=\"noopener\">Graylog<\/a> simplifies system monitoring and troubleshooting. If you&#8217;re looking to enhance your system&#8217;s visibility, you can easily install Graylog on Ubuntu 24.04 to streamline log management and improve overall operational efficiency.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Graylog, built on Elasticsearch for data storage and MongoDB for metadata management, offers a web-based interface for efficient log interaction. It is extensively used for processing large amounts of machine-generated data, making it perfect for security monitoring, tracking system performance, and resolving issues. To take full advantage of its capabilities, you can easily install Graylog on Ubuntu 24.04, which provides a reliable platform for managing and analyzing log data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Install Dependencies<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Install several necessary utilities like curl, gnupg, and apt-transport-https:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt install apt-transport-https gnupg2 uuid-runtime pwgen curl dirmngr -y<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Update your system\u2019s package list:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt update\napt upgrade<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Install MongoDB<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">MongoDB is required for Graylog to store its configurations and metadata. Add the MongoDB repository\u2019s GPG key:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -fsSL https:\/\/www.mongodb.org\/static\/pgp\/server-7.0.asc | gpg -o \/usr\/share\/keyrings\/mongodb-server-7.0.gpg --dearmor\necho \"deb &#91; arch=amd64,arm64 signed-by=\/usr\/share\/keyrings\/mongodb-server-7.0.gpg ] https:\/\/repo.mongodb.org\/apt\/ubuntu jammy\/mongodb-org\/7.0 multiverse\" | tee \/etc\/apt\/sources.list.d\/mongodb-org-7.0.list\napt update\napt install mongodb-org -y<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Start and enable MongoDB<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl enable --now mongod\nsystemctl status mongod<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Install Java (OpenJDK 11)<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Graylog requires Java to run. We\u2019ll install OpenJDK 11:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt install openjdk-11-jre-headless<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check the installation:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>java --version<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Install Elasticsearch<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Graylog uses Elasticsearch for storing and indexing logs. First, import the Elasticsearch GPG key:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -fsSL https:\/\/artifacts.elastic.co\/GPG-KEY-elasticsearch | gpg --dearmor -o \/usr\/share\/keyrings\/elastic-archive-keyring.gpg\necho \"deb &#91;signed-by=\/usr\/share\/keyrings\/elastic-archive-keyring.gpg] https:\/\/artifacts.elastic.co\/packages\/oss-7.x\/apt stable main\" | tee \/etc\/apt\/sources.list.d\/elastic-7.x.list\napt update &amp;&amp; apt install elasticsearch-oss<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Reload systemd, enable, and start Elasticsearch:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl daemon-reload\nsystemctl enable --now elasticsearch\nsystemctl status elasticsearch<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Verify Elasticsearch is running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -X GET http:\/\/localhost:9200<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\" id=\"h-install-graylog\"><strong>Install Graylog<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Next, we will install the Graylog server. Download the Graylog repository package:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget https:\/\/packages.graylog2.org\/repo\/packages\/graylog-6.1-repository_latest.deb<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Install the downloaded package:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dpkg -i graylog-6.1-repository_latest.deb<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Update the package list and install the Graylog server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt update\napt install graylog-server -y<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Generate a Password Secret and Hash for Admin Password<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Graylog requires a password secret for encryption. Generate a random secret with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt; \/dev\/urandom tr -dc A-Z-a-z-0-9 | head -c${1:-96};echo;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To hash the admin password, use this command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo -n \"Enter Password: \" &amp;&amp; head -1 &lt;\/dev\/stdin | tr -d '\\n' | sha256sum | cut -d\" \" -f1<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-configure-graylog\"><strong>Configure Graylog<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now, let\u2019s configure Graylog by editing its configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim \/etc\/graylog\/server\/server.conf<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Make the following changes:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Set the password secret:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>password_secret = your_random_password_secret<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Set the root password hash:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root_password_sha2 = your_sha256_password_hash_here<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Set the MongoDB URI:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mongodb_uri = mongodb:\/\/localhost:27017\/graylog<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Set the Elasticsearch hosts:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>elasticsearch_hosts = http:\/\/127.0.0.1:9200<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading has-small-font-size\" id=\"h-start-and-enable-graylog-server\"><strong>Start and Enable Graylog Server<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Reload systemd, enable and start the Graylog service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl daemon-reload\nsystemctl enable --now graylog-server\nsystemctl status graylog-server<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading has-small-font-size\" id=\"h-nbsp-access-graylog-web-interface\"><strong>&nbsp;Access Graylog Web Interface<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Now that Graylog is installed and running, you can access its web interface. Open your browser and go to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;your_server_ip:9000<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Log in using the following credentials:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Username: admin\n\nPassword: The password you set in the root_password_sha2 field<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you need assistance with the installation or setup of Graylog on Ubuntu 24.04, our support team is here to help. Whether you&#8217;re facing challenges during the installation process or need guidance on configuring Graylog for optimal performance, we offer expert support to ensure a smooth experience. <a href=\"https:\/\/www.skynats.com\/blog\/\">Contact us<\/a> today, and we&#8217;ll guide you step-by-step on how to install<strong> <\/strong>Graylog on Ubuntu 24.04 and ensure it\u2019s running efficiently to meet your log management needs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Graylog is a powerful open-source log management platform that provides real-time insights into your infrastructure&#8217;s performance and health. By enabling the collection, indexing, and analysis of log data from various sources, Graylog simplifies system monitoring and troubleshooting. If you&#8217;re looking to enhance your system&#8217;s visibility, you can easily install Graylog on Ubuntu 24.04 to streamline [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[949,948,899],"class_list":["post-13973","post","type-post","status-publish","format-standard","hentry","category-blog","tag-graylog","tag-install-graylog-on-ubuntu-24-04","tag-ubuntu-24-04"],"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/13973","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=13973"}],"version-history":[{"count":0,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/13973\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=13973"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=13973"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=13973"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}