> For the complete documentation index, see [llms.txt](https://docs.livestreamiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.livestreamiq.com/readme-1/2.-installation/2.3-container-installation.md).

# 2.3 Container Installation

This section describes how to deploy LivestreamIQ along with a PostgreSQL database backed by TimescaleDB using Docker Compose.

The Container installation deployment takes place to create two containers:

* **TimescaleDB (PostgreSQL)** for storing application and metrics data.
* **LivestreamIQ** application for monitoring and managing Apache Kafka environments.

### 1. Pre-Requisite:

Before proceeding with the installation, ensure the following requirements are met:

* Docker Engine 24.x or later
* Docker Compose v2
* Minimum 8 GB RAM
* At least 100 GB free disk space

### 2. Installation Steps:

Step 1: Create the Docker Compose File

1. Create a file named **`docker-compose.yml`** in your preferred working directory.<br>

   ```
   version: "3.9"
   services:
     postgres:
       image: timescale/timescaledb:latest-pg16
       container_name: timescale_pg
       restart: always
       ports:
         - "5432:5432"
       environment:
         POSTGRES_USER: postgres
         POSTGRES_PASSWORD: StrongPassword123
         POSTGRES_DB: lvs
         TZ: Asia/Kolkata
       command: postgres -c shared_preload_libraries=timescaledb
       volumes:
         - postgres_data:/var/lib/postgresql/data
       healthcheck:
         test: ["CMD-SHELL", "pg_isready -U postgres -d lvs"]
         interval: 10s
         timeout: 5s
         retries: 10
     livestreamiq:
       image: docker/livestreamiq/livestreqmiq:latest
       container_name: livestreamiq
       restart: always
       depends_on:
         postgres:
           condition: service_healthy
       ports:
         - "8080:8080"
       environment:
         LVS_DB_URL: r2dbc:postgresql://192.168.96.24:5432/lvs
         LVS_DB_USERNAME: postgres
         LVS_DB_PASSWORD: StrongPassword123
         ALLOW_ORIGIN: "http://192.168.96.24:8080"
   volumes:
     postgres_data:
   ```

Step 2: Deploy the Application Stack

1. Navigate to the directory containing the **`docker-compose.yml`** file.
2. Start the application stack in detached mode.<br>

   ```
   docker compose up -d
   ```
3. Verify that both containers are running successfully.<br>

   ```
   docker compose ps       
   ```

   \
   Expected Result: Both the **TimescaleDB** and **LivestreamIQ** containers should display a **Running** or **Healthy** status.

Step 3: Verify the Deployment

1. Verify the PostgreSQL (TimescaleDB) container logs.<br>

   ```
   docker compose logs -f postgres
   ```
2. Verify the LivestreamIQ application logs.<br>

   ```
   docker compose logs -f livestreamiq
   ```

Step 4: Manage the Docker Deployment

Use the following Docker Compose commands to manage the LivestreamIQ deployment.

<table data-search="false"><thead><tr><th>Action</th><th>Command</th></tr></thead><tbody><tr><td>Start stack</td><td>docker compose up -d</td></tr><tr><td>Stop stack</td><td>docker compose down</td></tr><tr><td>Stop and remove volumes</td><td>docker compose down -v</td></tr><tr><td>Restart one service</td><td>docker compose restart livestreamiq</td></tr><tr><td>View status</td><td>docker compose ps</td></tr><tr><td>View logs</td><td>docker compose logs -f livestreamiq</td></tr><tr><td>Pull latest images</td><td>docker compose pull</td></tr><tr><td>Recreate after image update</td><td>docker compose up -d --force-recreate</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.livestreamiq.com/readme-1/2.-installation/2.3-container-installation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
