Skip to main content
In this guide, you’ll learn how to install Loki on your local machine and configure it to work with Promtail as your logging agent. For more detailed information, please refer to the official Loki documentation.

1. Overview

Loki provides multiple deployment options including Helm charts for Kubernetes and Docker container installations. This guide focuses on installing Loki locally. Before you begin, visit the Loki documentation page and review the installation instructions.

2. Downloading Configuration Files for Loki and Promtail

Start by downloading the configuration files necessary for both Loki and Promtail. Open your terminal and execute the following commands:
These commands download a basic configuration for a local setup. Feel free to modify these files later according to your specific logging requirements.

3. Downloading the Loki Binary

Select the appropriate release for your system architecture. Visit the Loki release page for the latest version. For example, to download and prepare the Loki binary, run the following commands:
After these commands, confirm the presence of the Loki binary by listing your directory contents. If the zip file has not been extracted, you can run:
You should now see the executable Loki binary in your working directory.

4. Reviewing the Loki Configuration File

If you haven’t already obtained the configuration file, download it by running:
You can open and inspect the configuration file using your preferred text editor. For example:
A typical configuration file includes settings for the HTTP server (port 3100), the gRPC server (port 9096), and filesystem storage for log chunks and rules. Here is an example snippet:
This configuration instructs Loki to use the local file system for storage. You can modify these settings or switch to another storage backend, such as S3, based on your needs. For more tailored configurations, consult the Loki documentation.

5. Running Loki

Once the configuration file is ready, you can start Loki. Use the appropriate command for your operating system:

For Windows

For Linux

When you run the executable, Loki will start up and display several log messages. Look for logs similar to the following to confirm that it has started correctly:
These log messages indicate that Loki is initializing its internal processes and joining the cluster ring successfully.

6. Verifying the Installation

To ensure Loki is running as expected, open your web browser and navigate to: http://[LOKI_SERVER_IP]:3100/metrics Replace [LOKI_SERVER_IP] with the actual IP address or DNS name of your Loki server. If everything is set up correctly, you will see the metrics output similar to what is shown in the logs.
Now that Loki is successfully installed, consider exploring additional configuration options and integrations with Promtail for a comprehensive logging solution. Visit the Loki documentation for further details and advanced configurations.
Enjoy your Loki installation and happy logging!

Watch Video