This tutorial will guide you through the process of installing Graylog on FreeBSD version Latest.
Before proceeding with the installation of Graylog, make sure you have the following prerequisites installed:
Graylog requires Java Runtime Environment (JRE) version 8 or higher to be installed on your system. Follow the steps below to install JRE.
Update the package repository index:
pkg update
Install OpenJDK 8:
pkg install openjdk8
Verify that Java is installed correctly:
java -version
This command should return the Java version information.
Graylog requires Elasticsearch version 5 or higher to be installed. Follow the steps below to install Elasticsearch.
Download and install the Elasticsearch package:
pkg install elasticsearch5
Enable Elasticsearch to start at system boot:
sysrc elasticsearch_enable=YES
Start Elasticsearch service:
service elasticsearch start
Verify that Elasticsearch service is running:
service elasticsearch status
This command should return the message elasticsearch is running as pid <PID>
.
Download the Graylog package:
fetch https://packages.graylog2.org/releases/graylog/graylog-4.1.4.tgz
Extract the Graylog package:
tar -xzf graylog-4.1.4.tgz
Move the extracted Graylog directory to /usr/local
directory:
mv graylog-4.1.4 /usr/local/graylog
Create a Graylog system user and group:
pw group add graylog -g 940
pw user add graylog -u 940 -g graylog -d /nonexistent -s /usr/sbin/nologin
Create a storage directory for Graylog:
mkdir -p /usr/local/graylog/data/journal
chown -R graylog:graylog /usr/local/graylog/data
chmod -R 755 /usr/local/graylog/data
Configure Graylog by creating a configuration file at /usr/local/graylog/conf/graylog.conf
. You can use the following command to create the configuration file:
cp /usr/local/graylog/conf/graylog.conf.example /usr/local/graylog/conf/graylog.conf
Edit the configuration file and make the following changes:
# Set the password_secret to a secret value (minimum 64 characters):
password_secret = <generate_password_secret>
# Set the root_username and root_password_sha2 to the desired root user credentials:
root_username = <desired_username>
root_password_sha2 = <desired_password_sha2>
# Set the elasticsearch_hosts to the address of the Elasticsearch instance:
elasticsearch_hosts = http://localhost:9200
Set the ownership and permissions for the Graylog configuration file:
chown root:graylog /usr/local/graylog/conf/graylog.conf
chmod 0640 /usr/local/graylog/conf/graylog.conf
Start the Graylog service:
/usr/local/graylog/bin/graylogctl start
Verify that the Graylog service is running:
/usr/local/graylog/bin/graylogctl status
This command should return the message graylog-server running (pid: <PID>)
.
Once the Graylog service is up and running, you can access the Graylog web interface using your web browser.
Open your web browser and navigate to http://<graylog-server-ip>:9000
.
Make sure to replace <graylog-server-ip>
with the IP address of your Graylog server.
Log in to the Graylog web interface using the root user credentials that you configured earlier in the Graylog configuration file.
Congratulations! You have successfully installed Graylog on your FreeBSD Latest system.
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!