# Deploying HQ

The HQ docker image can be configured via volume mounts for the configuration file.

{% hint style="info" %}
The HQ looks for the **config.yaml** in the current working directory. This is the root directory for Docker.
{% endhint %}

## Running the Docker <a href="#running-the-docker" id="running-the-docker"></a>

{% code title="terminal" %}

```bash
docker run --name lenses-hq \
--network panoptes \
-p 8080:8080 \
-v $(pwd)/config.yaml:/config.yaml\
lensting/lenses-hq:6-preview
```

{% endcode %}

***

## Prerequisites

The main pre-requirements that has to be fulfilled before Lenses HQ container can be started and those are:

* [x] Postgres database
  * [x] See Lenses [docs here](https://docs.lenses.io/latest/getting-started/connecting-lenses-to-your-environment/overview#postgres) for information on configuring Postgres to work with Agent.&#x20;

## Complete configuration file

{% hint style="success" %}
In demo purposes and testing the product you can use our community license

```yaml
license_key_2SFZ0BesCNu6NFv0-EOSIvY22ChSzNWXa5nSds2l4z3y7aBgRPKCVnaeMlS57hHNVboR2kKaQ8Mtv1LFt0MPBBACGhDT5If8PmTraUM5xXLz4MYv
```

{% endhint %}

Main configuration file that has to be configured before running docker command is **config.yaml**.

{% hint style="info" %}
Assertion Consumer Service endpoint is following

```
/api/v2/auth/saml/callback?client_name=SAML2Client
```

{% endhint %}

Sample configuration file is following:

{% code title="config.yaml" %}

```yaml
auth:
  administrators:
    - admin
    - admin@company.com
  users:
    - username: admin
      # bcrypt("correcthorsebatterystaple").
      password: $2a$10$F66cb6ZhnJjGCZuxlvKP1e84eytTpT1MDJcpBblHaZgsqp1/Aa0LG
  sessionDuration: 24h
  saml:
    enabled: true
    baseURL: https://lenses6.company.com
    entityID: https://lenses6.company.com
    metadata: |          
         <?xml version="1.0" encoding="UTF-8"?><md:EntityDescriptor
          xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
            </md:IDPSSODescriptor>
          </md:EntityDescriptor>
          
    userCreationMode: manual
    groupMembershipMode: manual
    uiRootURL: /
    groupAttributeKey: groups
    authnRequestSignature:
      enabled: false
http:
  address: :8080
  accessControlAllowOrigin:
    - https://lenses6.company.com
  accessControlAllowCredentials: false
  secureSessionCookies: false
  
agents:
  address: :10000
  
database:
  host: postgres-postgresql.postgres.svc.cluster.local:5432
  username: $(LENSESHQ_PG_USERNAME)
  password: $(LENSESHQ_PG_PASSWORD)
  schema:
  database: lenseshq
  TLS: false
license:
  key: license_key_
  acceptEULA: true
logger:
  mode: text
  level: debug
metrics:
  prometheusAddress: :9090

```

{% endcode %}

More about configuration options you can find on the [HQ configuration](/latest/devx/6.0/deployment/configuration/agent/automation/hq.md) page.

***

## What's next?

After the successful configuration and installation of HQ, the next steps would be:

1. [**Deploying and Agent**](/latest/devx/6.0/deployment/installation/docker/agent.md)
2. [**Configuring IAM roles / groups / policies**](/latest/devx/6.0/user-guide/iam/example-policies.md)


---

# Agent Instructions: 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:

```
GET https://docs.lenses.io/latest/devx/6.0/deployment/installation/docker/hq.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
