{"id":632,"date":"2023-12-27T06:01:56","date_gmt":"2023-12-27T06:01:56","guid":{"rendered":"https:\/\/techtutelage.net\/?p=632"},"modified":"2025-05-18T05:05:17","modified_gmt":"2025-05-18T05:05:17","slug":"installing-graylog-5-on-debian-a-step-by-step-guide","status":"publish","type":"post","link":"https:\/\/techtutelage.net\/?p=632","title":{"rendered":"Installing Graylog 5 on Debian: A Step-by-Step Guide"},"content":{"rendered":"\n<p>Graylog is a robust open-source log management solution designed to simplify the process of collecting, indexing, and analyzing log data. In this step-by-step guide, we will delve into the installation of Graylog 5 on a Debian system. By the end of this tutorial, you&#8217;ll have a fully operational Graylog instance ready to streamline your log management workflow.<\/p>\n\n\n\n<p><strong>Step 1: <\/strong>Before diving into Graylog installation, ensure that your system has the required dependencies. The commands provided will install essential packages and tools needed for the subsequent steps.<\/p>\n\n\n\n<pre class=\"wp-block-code has-light-green-cyan-color has-black-background-color has-text-color has-background has-link-color wp-elements-ae066d7191ed24a437bfd2fc93a13021\"><code>sudo apt install apt-transport-https openjdk-11-jre-headless uuid-runtime pwgen dirmngr gnupg wget<\/code><\/pre>\n\n\n\n<p><strong>Step 2: Install MongoDB<\/strong> Graylog relies on MongoDB as its backend database. The commands in this step download and install MongoDB version 5.0, configure the repository, and set up the MongoDB service.<\/p>\n\n\n\n<pre class=\"wp-block-code has-light-green-cyan-color has-black-background-color has-text-color has-background has-link-color wp-elements-c54b0f470b8d2402961f696bfbc28561\"><code>wget -qO - https:\/\/www.mongodb.org\/static\/pgp\/server-5.0.asc | sudo apt-key add -\necho \"deb http:\/\/repo.mongodb.org\/apt\/debian buster\/mongodb-org\/5.0 main\" | sudo tee \/etc\/apt\/sources.list.d\/mongodb-org-5.0.list\nsudo apt update\nsudo apt install -y mongodb-org\nsudo systemctl daemon-reload\nsudo systemctl enable mongod.service\nsudo systemctl restart mongod.service\nsudo systemctl status mongod<\/code><\/pre>\n\n\n\n<p><strong>Step 3: Install Elasticsearch<\/strong> Elasticsearch serves as the storage and retrieval engine for Graylog. This step involves installing Elasticsearch version 7.x, configuring its settings, and ensuring it starts as a system service.<\/p>\n\n\n\n<pre class=\"wp-block-code has-light-green-cyan-color has-black-background-color has-text-color has-background has-link-color wp-elements-6632e486f081dcf13e781b065d77cb12\"><code>wget -qO - https:\/\/artifacts.elastic.co\/GPG-KEY-elasticsearch | sudo apt-key add -\necho \"deb https:\/\/artifacts.elastic.co\/packages\/oss-7.x\/apt stable main\" | sudo tee -a \/etc\/apt\/sources.list.d\/elastic-7.x.list\nsudo apt update\nsudo apt install elasticsearch-oss\n\nsudo tee -a \/etc\/elasticsearch\/elasticsearch.yml > \/dev\/null &lt;&lt; EOT\ncluster.name: graylog\naction.auto_create_index: false\nEOT\n\n# OPTIONAL: Adjust JVM Memory Limits\nnano \/etc\/elasticsearch\/jvm.options\n\nsudo systemctl daemon-reload\nsudo systemctl enable elasticsearch.service\nsudo systemctl restart elasticsearch.service\nsudo systemctl status elasticsearch.service<\/code><\/pre>\n\n\n\n<p><strong>Step 4: Test Elasticsearch (Optional) <\/strong>Verify the correct installation and functionality of Elasticsearch by using the provided optional command. This step is crucial to ensure that Elasticsearch is running and accessible on the specified port.<\/p>\n\n\n\n<pre class=\"wp-block-code has-light-green-cyan-color has-black-background-color has-text-color has-background has-link-color wp-elements-7ddb987e5f076811ca690cc15572e2b2\"><code>apt install curl\ncurl http:\/\/localhost:9200\/<\/code><\/pre>\n\n\n\n<p><strong>Step 5: Install Graylog <\/strong>Download and install the Graylog repository, update the package list, and install the Graylog server. This step sets the foundation for the Graylog instance on your Debian system.<\/p>\n\n\n\n<pre class=\"wp-block-code has-light-green-cyan-color has-black-background-color has-text-color has-background has-link-color wp-elements-f1b2fad7b78f9ce924a3757b2adbbf80\"><code>wget https:\/\/packages.graylog2.org\/repo\/packages\/graylog-5.2-repository_latest.deb\nsudo dpkg -i graylog-5.2-repository_latest.deb\nsudo apt update\nsudo apt install graylog-server<\/code><\/pre>\n\n\n\n<p><strong>Step 6: Configure Graylog<\/strong> Generate a secure password for Graylog, configure its settings, and adjust JVM memory limits if needed. This step ensures that Graylog is properly configured and secured. It also involves editing the server configuration file to bind Graylog to the specified IP address.<\/p>\n\n\n\n<p>Generate &#8220;password_secret&#8221;.<\/p>\n\n\n\n<pre class=\"wp-block-code has-light-green-cyan-color has-black-background-color has-text-color has-background has-link-color wp-elements-249af7b305eb697885da45c1c1c3ed2c\"><code>pwgen -N 1 -s 96<\/code><\/pre>\n\n\n\n<p>Generate &#8220;root_password_sha2&#8221;, this generates hashed value of your &#8220;admin&#8221; user password.<\/p>\n\n\n\n<pre class=\"wp-block-code has-light-green-cyan-color has-black-background-color has-text-color has-background has-link-color wp-elements-c8004008ada103f679615237db5a5323\"><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<p>Copy and paste the generated &#8220;password_secret&#8221; and hashed admin password &#8220;root_password_sha2&#8221; in to &#8220;server.conf&#8221; <\/p>\n\n\n\n<pre class=\"wp-block-code has-light-green-cyan-color has-black-background-color has-text-color has-background has-link-color wp-elements-a42d0fd3c48547cbcaa4c56f2eee3b08\"><code>sudo nano \/etc\/graylog\/server\/server.conf<\/code><\/pre>\n\n\n\n<p>Add the line below to &#8220;server.comf&#8221; to allow access to Graylog from hosts other than local host.<\/p>\n\n\n\n<pre class=\"wp-block-code has-light-green-cyan-color has-black-background-color has-text-color has-background has-link-color wp-elements-8c0872beba30d481fad7259b49296825\"><code>http_bind_address = 0.0.0.0<\/code><\/pre>\n\n\n\n<p>OPTIONALLY: Adjust JVM Memory Limits.<\/p>\n\n\n\n<pre class=\"wp-block-code has-light-green-cyan-color has-black-background-color has-text-color has-background has-link-color wp-elements-ee1236331c49abd0f64a6522b8cbecb0\"><code>nano \/etc\/default\/graylog-server<\/code><\/pre>\n\n\n\n<p>Ensure Graylog is running and is set to start as a system service.<\/p>\n\n\n\n<pre class=\"wp-block-code has-light-green-cyan-color has-black-background-color has-text-color has-background has-link-color wp-elements-2fcd325a31200595be4339c0b871804c\"><code>\nsudo systemctl daemon-reload\nsudo systemctl enable graylog-server.service\nsudo systemctl start graylog-server.service\nsudo systemctl status graylog-server.service<\/code><\/pre>\n\n\n\n<p>Congratulations! You&#8217;ve successfully installed Graylog 5 on Debian. You can now access the Graylog web interface by navigating to <code>http:\/\/&lt;your-server-ip>:9000\/<\/code> in your web browser. Replace <code>&lt;your-server-ip><\/code> with the actual IP address or hostname of your Graylog server.<\/p>\n\n\n\n<p><strong>Security Considerations:<\/strong> While Graylog is now accessible, it&#8217;s important to note that exposing services to all network interfaces may have security implications. To enhance security, it is strongly recommended to set up a reverse proxy with SSL\/TLS for encrypted and secure connections.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Graylog is a robust open-source log management solution designed to simplify the process of collecting, indexing, and analyzing log data. In this step-by-step guide, we will delve into the installation of Graylog 5 on a Debian system. By the end of this tutorial, you&#8217;ll have a fully operational Graylog instance ready to streamline your log [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,1],"tags":[],"class_list":["post-632","post","type-post","status-publish","format-standard","hentry","category-tutorials","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/posts\/632","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/techtutelage.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=632"}],"version-history":[{"count":1,"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/posts\/632\/revisions"}],"predecessor-version":[{"id":633,"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/posts\/632\/revisions\/633"}],"wp:attachment":[{"href":"https:\/\/techtutelage.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techtutelage.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techtutelage.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}