> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langtrace.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Docker Setup

> Run Langtrace App using Docker

## Requirements

1. Clickhouse DB self hosted or managed service
2. Postgres self hosted or managed service

## Step 1: Clone the repository

Clone the repository using the following command

```bash theme={null}
git clone https://github.com/Scale3-Labs/langtrace
cd langtrace
```

## Step 2: Configure environment variables

Langtrace needs postgres and clickhouse to run. Update the Postgres and Clickhouse connection details in the `.env` file to point to your database.

<Note>
  Make sure the Postgres and Clickhouse databases are running and accessible
  from the Langtrace app. If you wish to run them using Docker, checkout the
  docker compose guide [here](./docker-compose).
</Note>

### Authentication Configuration

Langtrace supports multiple authentication methods. Configure the necessary environment variables for your chosen authentication method(s) in the .env file. For detailed instructions, refer to our [Authentication](/hosting/auth) guide.

## Step 3: Build the Docker image

This is an **optional step**, skip this step if you want to use the pre-built Docker image.

Run the following command to build the Docker image:

```bash theme={null}
docker build -t scale3labs/langtrace-client .
```

## Step 4: Run the Docker container

Run the following command to start the Langtrace app

```bash theme={null}
docker run -d -p 3000:3000 --env-file .env --name langtrace scale3labs/langtrace-client:latest /bin/sh -c "npm run create-tables && npm run dev"
```

The Langtrace app will be available at `http://localhost:3000`

<Tip>
  If you wish to manually pull the specific [release](https://github.com/Scale3-Labs/langtrace/releases) version of the Docker image from docker hub, you can use the following command

  ```bash theme={null}
  docker pull langtrace.docker.scarf.sh/scale3labs/langtrace-client:<Release Version>
  ```
</Tip>

### Next Steps

After setting up Langtrace, make sure to configure your chosen authentication method(s) and create the necessary user accounts. Refer to the [Authentication](/hosting/auth) guide for detailed instructions.
