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 Caffe on Ubuntu?
Caffe is a famous open-source deep learning framework developed and maintained by Berkley AI Research (BAIR). It's extremely flexible, modular, and quick. On Github, there is a wealth of open-source documentation for Caffer. It's commonly utilised in university research projects, proofs-of-concept f
1 min read
How to Install Golang Migrate on Ubuntu?
Schema migration is an important activity when dealing with databases that we frequently have to perform during the application's life cycle to adapt to new business needs. Golang migrate is a tool which helps in this operation. Installing Golang Migrate on Ubuntu Step 1: Open the terminal for execu
1 min read
How to install make on Ubuntu
The "make" program in Linux is used to compile and manage a set of source code applications and files. It allows developers to install and gather a range of apps via the terminal. It also controls and cuts down on the amount of time necessary for compilation. The basic objective of the make command
3 min read
How to Install alsa-tools on Ubuntu?
A set of console-based utilities for specific sound gear: ALSA Tools is a set of console-based utilities for specific sound devices. It organizes sound hardware tasks and provides services for them. as10k1 - An assembler for the DSP chip EMU10K1 (EMU10K2). Send HD audio commands to Intel HDA devices
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
4 min read
How to Install Chrome on Ubuntu
We all know that Ubuntu did not come with pre-install Google Chrome it comes with Firefox or Chromium web browser. But what if you are a Google Chrome fan? According to Statcounter, 66.29% of the market share of web browsers is occupied by Chrome browsers just because it offers speed, security, and
13 min read
How to install Elinks on Ubuntu?
If you are searching for any Text-Based Web Browser for any Linux Distribution like Ubuntu, then the Elinks on Ubuntu will be the best to use. The Elinks Web Browser on Ubuntu can even enhance the Command Line Experience. Not only on Ubuntu OS but the Installation of Elinks can be done on Windows OS
3 min read
How To Install 2048 on Ubuntu
The 2048 game is a math-based puzzle game in which you must slide tiles on a 4x4 grid in one of four ways. Touching tiles of the same value are combined into tiles with the merged ones' extra value. After sliding, additional tiles appear at random, starting with a few 2-valued tiles. Before the boar
2 min read