> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-fbfa8bee.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Lightdash is a modern open-source BI tool built on top of dbt, enabling teams to explore and visualize data from ClickHouse through a semantic layer. Learn how to connect Lightdash to ClickHouse for fast, governed analytics powered by dbt.

# Lightdash

export const PartnerBadge = () => {
  return <div className="PartnerBadge">
            <div className="PartnerBadgeIcon">
                <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
                    <polyline points="12.5 9.5 10 12 6 11 2.5 8.5" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <polyline points="4.54 4.41 8 3.5 11.46 4.41" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <path d="M2.15,3.78 L0.55,6.95 A0.5,0.5 0,0,0 0.77,7.62 L2.5,8.5 L4.54,4.41 L2.82,3.55 A0.5,0.5 0,0,0 2.15,3.78 Z" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <path d="M13.5,8.5 L15.23,7.62 A0.5,0.5 0,0,0 15.45,6.95 L13.85,3.78 A0.5,0.5 0,0,0 13.18,3.55 L11.46,4.41 Z" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <path d="M11.5,4.5 L9,4.5 L6.15,7.27 A0.5,0.5 0,0,0 6.24,8.05 C7.33,8.74 8.81,8.72 10,7.5 L12.5,9.5 L13.5,8.5" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <polyline points="7.75 13.5 5.15 12.85 3.5 11.67" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                </svg>
            </div>
            Partner Integration
        </div>;
};

export const Image = ({img, alt, size}) => {
  return <Frame>
      <img src={img} alt={alt} />
    </Frame>;
};

Lightdash is the **AI-first BI platform** built for modern data teams, combining the openness of dbt with the performance of ClickHouse. By connecting ClickHouse to Lightdash, teams get an **AI-powered self-serve analytics experience** grounded in their dbt semantic layer, so every question is answered with governed, consistent metrics.

Developers love Lightdash for its open architecture, version-controlled YAML models, and integrations that fit directly into their workflow - from GitHub to the IDE.

This partnership brings together **ClickHouse’s speed** and **Lightdash’s developer experience**, making it easier than ever to explore, visualize, and automate insights with AI.

<h2 id="build-an-interactive-dashboard">
  Build an interactive dashboard with Lightdash and ClickHouse
</h2>

In this guide, you’ll see how **Lightdash** connects to **ClickHouse** to explore your dbt models and build interactive dashboards.\
The example below shows a finished dashboard powered by data from ClickHouse.

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/lightdash_02.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=9d5a30d3e05195dad44c535fef42d11f" alt="Lightdash dashboard example" border width="2966" height="1728" data-path="images/integrations/data-visualization/lightdash_02.png" />

<Steps>
  <Step>
    <h3 id="connection-data-required">
      Gather connection data
    </h3>

    When setting up your connection between Lightdash and ClickHouse, you’ll need the following details:

    * **Host:** The address where your ClickHouse database is running
    * **User:** Your ClickHouse database username
    * **Password:** Your ClickHouse database password
    * **DB name:** The name of your ClickHouse database
    * **Schema:** The default schema used by dbt to compile and run your project (found in your `profiles.yml`)
    * **Port:** The ClickHouse HTTPS interface port (default: `8443`)
    * **Secure:** Enable this option to use HTTPS/SSL for secure connections
    * **Retries:** Number of times Lightdash retries failed ClickHouse queries (default: `3`)
    * **Start of week:** Choose which day your reporting week starts; defaults to your warehouse setting

    To connect to ClickHouse with HTTP(S) you need this information:

    | Parameter(s)              | Description                                                                                                    |
    | ------------------------- | -------------------------------------------------------------------------------------------------------------- |
    | `HOST` and `PORT`         | Typically, the port is 8443 when using TLS or 8123 when not using TLS.                                         |
    | `DATABASE NAME`           | Out of the box, there is a database named `default`, use the name of the database that you want to connect to. |
    | `USERNAME` and `PASSWORD` | Out of the box, the username is `default`. Use the username appropriate for your use case.                     |

    The details for your ClickHouse Cloud service are available in the ClickHouse Cloud console.
    Select a service and click **Connect**:

    <Image img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/cloud-connect-button.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=a41d53ce6c46ccccb2855331a8dcc841" size="md" alt="ClickHouse Cloud service connect button" border width="998" height="932" data-path="images/_snippets/cloud-connect-button.png" />

    Choose **HTTPS**. Connection details are displayed in an example `curl` command.

    <Image img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/connection-details-https.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=0377c34215bd524b359c0d20dd96bed3" size="md" alt="ClickHouse Cloud HTTPS connection details" border width="1320" height="1184" data-path="images/_snippets/connection-details-https.png" />

    If you're using self-managed ClickHouse, the connection details are set by your ClickHouse administrator.

    ***
  </Step>

  <Step>
    <h3 id="configuring-your-dbt-profile-for-clickhouse">
      Configure your dbt profile for ClickHouse
    </h3>

    In Lightdash, connections are based on your existing **dbt project**.\
    To connect ClickHouse, make sure your local `~/.dbt/profiles.yml` file contains a valid ClickHouse target configuration.

    For example:

    <Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/lightdash_01.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=b6cc1fcc666eb477f5fccb18fdd4dd3f" alt="Example profiles.yml configuration for a lightdash-clickhouse project" border width="1440" height="534" data-path="images/integrations/data-visualization/lightdash_01.png" />

    <br />
  </Step>

  <Step>
    <h3 id="creating-a-lightdash-project-connected-to-clickhouse">
      Create a Lightdash project connected to ClickHouse
    </h3>

    Once your dbt profile is configured for ClickHouse, you’ll also need to connect your **dbt project** to Lightdash.

    Because this process is the same for all data warehouses, we won’t go into detail here — you can follow the official Lightdash guide for importing a dbt project:

    [Import a dbt project → Lightdash Docs](https://docs.lightdash.com/get-started/setup-lightdash/connect-project#2-import-a-dbt-project?utm_source=clickhouse\&utm_medium=partner\&utm_campaign=integration_docs)

    After connecting your dbt project, Lightdash will automatically detect your ClickHouse configuration from the `profiles.yml` file. Once the connection test succeeds, you’ll be able to start exploring your dbt models and building dashboards powered by ClickHouse.

    ***
  </Step>

  <Step>
    <h3 id="exploring-your-clickhouse-data-in-lightdash">
      Explore your ClickHouse data in Lightdash
    </h3>

    Once connected, Lightdash automatically syncs your dbt models and exposes:

    * **Dimensions** and **measures** defined in YAML
    * **Semantic layer logic**, such as metrics, joins, and explores
    * **Dashboards** powered by real-time ClickHouse queries

    You can now build dashboards, share insights, and even use **Ask AI** to generate visualizations directly on top of ClickHouse — no manual SQL required.

    ***
  </Step>

  <Step>
    <h3 id="defining-metrics-and-dimensions-in-lightdash">
      Define metrics and dimensions in Lightdash
    </h3>

    In Lightdash, all **metrics** and **dimensions** are defined directly in your dbt model `.yml` files. This makes your business logic version-controlled, consistent, and fully transparent.

    <Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/lightdash_03.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=bddf59cfe7b0d33fe31d2c21518d0aca" alt="Example of metrics being defined in the .yml file" border width="1454" height="828" data-path="images/integrations/data-visualization/lightdash_03.png" />

    <br />

    Defining these in YAML ensures your team is using the same definitions across dashboards and analyses. For example, you can create reusable metrics like `total_order_count`, `total_revenue`, or `avg_order_value` right next to your dbt models — no duplication required in the UI.

    To learn more about how to define these, see the following Lightdash guides:

    * [How to create metrics](https://docs.lightdash.com/guides/how-to-create-metrics?utm_source=clickhouse\&utm_medium=partner\&utm_campaign=integration_docs)
    * [How to create dimensions](https://docs.lightdash.com/guides/how-to-create-dimensions?utm_source=clickhouse\&utm_medium=partner\&utm_campaign=integration_docs)

    ***
  </Step>

  <Step>
    <h3 id="querying-your-data-from-tables">
      Query your data from tables
    </h3>

    Once your dbt project is connected and synced with Lightdash, you can start exploring data directly from your **tables** (or “explores”).\
    Each table represents a dbt model and includes the metrics and dimensions you’ve defined in YAML.

    The **Explore** page is made up of five main areas:

    1. **Dimensions and Metrics** — all fields available on the selected table
    2. **Filters** — restrict the data returned by your query
    3. **Chart** — visualize your query results
    4. **Results** — view the raw data returned from your ClickHouse database
    5. **SQL** — inspect the generated SQL query behind your results

    <Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/lightdash_04.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=809ee4c0dbd23cb1545771b79f9f6d9d" alt="Lightdash Explore view showing dimensions, filters, chart, results, and SQL" border width="2002" height="1526" data-path="images/integrations/data-visualization/lightdash_04.png" />

    From here, you can build and adjust queries interactively — dragging and dropping fields, adding filters, and switching between visualization types such as tables, bar charts, or time series.

    For a deeper look at explores and how to query from your tables, see:\
    [An intro to tables and the Explore page → Lightdash Docs](https://docs.lightdash.com/get-started/exploring-data/using-explores#an-intro-to-tables-and-the-explore-page?utm_source=clickhouse\&utm_medium=partner\&utm_campaign=integration_docs)

    ***
  </Step>

  <Step>
    <h3 id="building-dashboards">
      Build dashboards
    </h3>

    Once you’ve explored your data and saved visualizations, you can combine them into **dashboards** to share with your team.

    Dashboards in Lightdash are fully interactive — you can apply filters, add tabs, and view charts powered by real-time ClickHouse queries.

    You can also create new charts **directly from within a dashboard**, which helps keep your projects organized and clutter-free. Charts created this way are **exclusive to that dashboard** — they can’t be reused elsewhere in the project.

    To create a dashboard-only chart:

    1. Click **Add tile**
    2. Select **New chart**
    3. Build your visualization in the chart builder
    4. Save it — it will appear at the bottom of your dashboard

    <Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/lightdash_05.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=12068cac0c75e3f1b60879f8cfd07e54" alt="Creating and organizing charts within a Lightdash dashboard" border width="2224" height="1412" data-path="images/integrations/data-visualization/lightdash_05.png" />

    Learn more about how to create and organize dashboards here:\
    [Building dashboards → Lightdash Docs](https://docs.lightdash.com/get-started/exploring-data/dashboards?utm_source=clickhouse\&utm_medium=partner\&utm_campaign=integration_docs)

    ***
  </Step>

  <Step>
    <h3 id="ask-ai">
      Ask AI: self-serve analytics powered by dbt
    </h3>

    **AI Agents** in Lightdash make data exploration truly self-serve.\
    Instead of writing queries, you can simply ask questions in plain language — like *“What was our monthly revenue growth?”* — and the AI Agent automatically generates the right visualization, referencing your dbt-defined metrics and models to ensure accuracy and consistency.

    It’s powered by the same semantic layer you use in dbt, meaning every answer stays governed, explainable, and fast — all backed by ClickHouse.

    <Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/lightdash_06.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=45033ceae411fe99b0a65733ef48427c" alt="Lightdash Ask AI interface showing natural language query powered by dbt metrics" border width="3022" height="1726" data-path="images/integrations/data-visualization/lightdash_06.png" />

    <Tip>
      Learn more about AI Agents here: [AI Agents → Lightdash Docs](https://docs.lightdash.com/guides/ai-agents?utm_source=clickhouse\&utm_medium=partner\&utm_campaign=integration_docs)
    </Tip>
  </Step>
</Steps>

<h2 id="learn-more">
  Learn more
</h2>

To learn more about connecting dbt projects to Lightdash, visit the [Lightdash Docs → ClickHouse setup](https://docs.lightdash.com/get-started/setup-lightdash/connect-project#clickhouse?utm_source=clickhouse\&utm_medium=partner\&utm_campaign=integration_docs).
