How to Install Grafana Loki on Ubuntu?
Last Updated :
30 Jul, 2024
Loki is a Prometheus-inspired multi-tenant, highly available, and possibly, horizontally scalable log aggregation system solution. A robust logging system called Grafana Loki is made to effectively gather, store, and query logs from several sources through the system. It is made by the software engineers to be incredibly simple to use and economical. It offers a complete observability internal stack and is designed to integrate with the Grafana system with ease.
In this article, we'll explore the initial steps to install and configure Grafana Loki on an Ubuntu system.
How to Install and Configure Grafana Loki on Ubuntu?
Grafana can be installed in different ways or techniques. Users need to follow the below-mentioned easy steps or techniques to install and configure Grafana Loki on Ubuntu OS.
Step 1: Install and Configure Grafana from the APT repository
- Download the prerequisite packages by following the below-mentioned command
sudo apt-get install -y apt-transport-https software-properties-common wget
- Import the internal GPG Key > Run the Command to add the repository for beta releases
sudo mkdir -p /etc/apt/keyrings/
wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
- Update the list of available packages
# Updates the list of available packages
sudo apt-get update
- Run the Command to install Grafana OSS
# Installs the latest OSS release:
sudo apt-get install grafana
- Run the Command to install Grafana Enterprise
# Installs the latest Enterprise release:
sudo apt-get install grafana-enterprise
Step 2: Install Loki
- Download Loki according to the system configuration and CPU architecture as shown below -
https://github.com/grafana/loki/releases/
- Unzip the pre-downloaded file
sudo apt install unzip -y
unzip loki-linux-amd64.zip
- Move the configured Loki binary to a directory in the system PATH
sudo mv loki-linux-amd64 /usr/local/bin/loki
sudo chmod a+x /usr/local/bin/loki
- Create a new Loki configuration file > Add new configuration > Save it and close
auth_enabled: false
server:
http_listen_port: 3100
ingester:
lifecycler:
address: 127.0.10.1
ring:
kvstore:
store: inmemory
replication_factor: 10
final_sleep: 1s
chunk_idle_period: 6m
chunk_retain_period: 45s
max_transfer_retries: 10
schema_config:
configs:
- from: 2024-10-22
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 22h
storage_config:
boltdb_shipper:
active_index_directory: /tmp/loki/index
cache_location: /tmp/loki/index_cache
shared_store: filesystems
filesystems:
directory: /tmp/loki/chunks
limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 154h
chunk_store_config:
max_look_back_period: 1s
table_manager:
retention_deletes_enabled: false
retention_period: 1s
Step 3: Download and Install Grafana using a .deb package
- Go to the Official Grafana Download Page > Select Version and Edition
- Click on the Linux or ARM64 tab as per requirement > Copy and Paste the given code in the command line.
Conclusion
Users can now get greater insights into the system infrastructure and applications with Grafana Loki, which simplifies internal troubleshooting and boosts the system's performance. All the users have to install Grafana Loki on their Ubuntu server and enable a reliable and effective logging system by following the mentioned steps or techniques. With this configuration, users can easily gather, store, and examine all the internal logs in conjunction with Grafana Loki on Ubuntu, offering a complete observability solution or process.
Also Read
Similar Reads
How to Install Krita on Ubuntu Krita is a picture editing and digital painting program that is free and open-source. Krita is a cross-platform application that is primarily designed for KDE Plasma. It also includes versions for Windows and macOS. Krita is a full-featured digital art studio with a simple user interface that hides
2 min read
How to install Marble on Ubuntu Marble is a virtual globe program that lets you pick between the Earth, Moon, Venus, Mars, and other planets to show as a 3-D model. KDE created it as free software under the provisions of the GNU LGPL for usage on personal computers and smartphones. It is written in C++ and uses the Qt framework. M
2 min read
How to Install Anaconda on Ubuntu 20.04 Anaconda is a distribution of Python and R that is used for data science, Machine learning and Scientific analysis. It is designed to simplify the process of managing several complex software environments and packages required for data scientists. It offers several libraries and packages required fo
5 min read
How to Install GitLab Runner on Ubuntu? GitLab Runner is a fantastic tool that works like a trusty helper for developers. It takes care of tasks that ensure your software runs smoothly, like testing and deploying. Installing GitLab Runner on your Ubuntu system is like giving yourself a superpower in software development. Automating many r
4 min read
How to Install MyPaint on Ubuntu MyPaint is an open-source, quick, cost-free, and user-friendly painting program that is comparable to Corel Painter. This program is typically used by graphic designers or digital painters for various tasks. It works with OSs similar to Unix as well as Windows, macOS, and Mac OS X. To provide users
3 min read