|
| 1 | +--- |
| 2 | +sidebar_label: 'Lightdash' |
| 3 | +sidebar_position: 131 |
| 4 | +slug: /integrations/lightdash |
| 5 | +keywords: ['clickhouse', 'lightdash', 'data visualization', 'BI', 'semantic layer', 'dbt', 'self-serve analytics', 'connect'] |
| 6 | +description: '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.' |
| 7 | +title: 'Connecting Lightdash to ClickHouse' |
| 8 | +doc_type: 'guide' |
| 9 | +integration: |
| 10 | + - support_level: 'partner' |
| 11 | + - category: 'data_visualization' |
| 12 | +--- |
| 13 | + |
| 14 | +import lightdash_01 from '@site/static/images/integrations/data-visualization/lightdash_01.png'; |
| 15 | +import lightdash_02 from '@site/static/images/integrations/data-visualization/lightdash_02.png'; |
| 16 | +import lightdash_03 from '@site/static/images/integrations/data-visualization/lightdash_03.png'; |
| 17 | +import lightdash_04 from '@site/static/images/integrations/data-visualization/lightdash_04.png'; |
| 18 | +import lightdash_05 from '@site/static/images/integrations/data-visualization/lightdash_05.png'; |
| 19 | +import lightdash_06 from '@site/static/images/integrations/data-visualization/lightdash_06.png'; |
| 20 | +import ConnectionDetails from '@site/docs/_snippets/_gather_your_details_http.mdx'; |
| 21 | +import Image from '@theme/IdealImage'; |
| 22 | +import PartnerBadge from '@theme/badges/PartnerBadge'; |
| 23 | + |
| 24 | +# Lightdash |
| 25 | + |
| 26 | +<PartnerBadge/> |
| 27 | + |
| 28 | +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. |
| 29 | + |
| 30 | +Developers love Lightdash for its open architecture, version-controlled YAML models, and integrations that fit directly into their workflow - from GitHub to the IDE. |
| 31 | + |
| 32 | +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. |
| 33 | + |
| 34 | +## Build an interactive dashboard with Lightdash and ClickHouse {#build-an-interactive-dashboard} |
| 35 | + |
| 36 | +In this guide, you’ll see how **Lightdash** connects to **ClickHouse** to explore your dbt models and build interactive dashboards. |
| 37 | +The example below shows a finished dashboard powered by data from ClickHouse. |
| 38 | + |
| 39 | +<Image size="md" img={lightdash_02} alt="Lightdash dashboard example" border /> |
| 40 | + |
| 41 | +<VerticalStepper headerLevel="h3"> |
| 42 | + |
| 43 | +### Gather connection data {#connection-data-required} |
| 44 | + |
| 45 | +When setting up your connection between Lightdash and ClickHouse, you’ll need the following details: |
| 46 | + |
| 47 | +- **Host:** The address where your ClickHouse database is running |
| 48 | +- **User:** Your ClickHouse database username |
| 49 | +- **Password:** Your ClickHouse database password |
| 50 | +- **DB name:** The name of your ClickHouse database |
| 51 | +- **Schema:** The default schema used by dbt to compile and run your project (found in your `profiles.yml`) |
| 52 | +- **Port:** The ClickHouse HTTPS interface port (default: `8443`) |
| 53 | +- **Secure:** Enable this option to use HTTPS/SSL for secure connections |
| 54 | +- **Retries:** Number of times Lightdash retries failed ClickHouse queries (default: `3`) |
| 55 | +- **Start of week:** Choose which day your reporting week starts; defaults to your warehouse setting |
| 56 | + |
| 57 | +<ConnectionDetails /> |
| 58 | + |
| 59 | +--- |
| 60 | + |
| 61 | +### Configure your dbt profile for ClickHouse {#configuring-your-dbt-profile-for-clickhouse} |
| 62 | + |
| 63 | +In Lightdash, connections are based on your existing **dbt project**. |
| 64 | +To connect ClickHouse, make sure your local `~/.dbt/profiles.yml` file contains a valid ClickHouse target configuration. |
| 65 | + |
| 66 | +For example: |
| 67 | + |
| 68 | +<Image size="md" img={lightdash_01} alt="Example profiles.yml configuration for a lightdash-clickhouse project" border /> |
| 69 | +<br/> |
| 70 | + |
| 71 | +### Create a Lightdash project connected to ClickHouse {#creating-a-lightdash-project-connected-to-clickhouse} |
| 72 | + |
| 73 | +Once your dbt profile is configured for ClickHouse, you’ll also need to connect your **dbt project** to Lightdash. |
| 74 | + |
| 75 | +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: |
| 76 | + |
| 77 | +[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) |
| 78 | + |
| 79 | +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. |
| 80 | + |
| 81 | +--- |
| 82 | + |
| 83 | +### Explore your ClickHouse data in Lightdash {#exploring-your-clickhouse-data-in-lightdash} |
| 84 | + |
| 85 | +Once connected, Lightdash automatically syncs your dbt models and exposes: |
| 86 | + |
| 87 | +- **Dimensions** and **measures** defined in YAML |
| 88 | +- **Semantic layer logic**, such as metrics, joins, and explores |
| 89 | +- **Dashboards** powered by real-time ClickHouse queries |
| 90 | + |
| 91 | +You can now build dashboards, share insights, and even use **Ask AI** to generate visualizations directly on top of ClickHouse — no manual SQL required. |
| 92 | + |
| 93 | +--- |
| 94 | + |
| 95 | +### Define metrics and dimensions in Lightdash {#defining-metrics-and-dimensions-in-lightdash} |
| 96 | + |
| 97 | +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. |
| 98 | + |
| 99 | +<Image size="md" img={lightdash_03} alt="Example of metrics being defined in the .yml file" border /> |
| 100 | +<br/> |
| 101 | + |
| 102 | +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. |
| 103 | + |
| 104 | +To learn more about how to define these, see the following Lightdash guides: |
| 105 | +- [How to create metrics](https://docs.lightdash.com/guides/how-to-create-metrics?utm_source=clickhouse&utm_medium=partner&utm_campaign=integration_docs) |
| 106 | +- [How to create dimensions](https://docs.lightdash.com/guides/how-to-create-dimensions?utm_source=clickhouse&utm_medium=partner&utm_campaign=integration_docs) |
| 107 | + |
| 108 | +--- |
| 109 | + |
| 110 | +### Query your data from tables {#querying-your-data-from-tables} |
| 111 | + |
| 112 | +Once your dbt project is connected and synced with Lightdash, you can start exploring data directly from your **tables** (or “explores”). |
| 113 | +Each table represents a dbt model and includes the metrics and dimensions you’ve defined in YAML. |
| 114 | + |
| 115 | +The **Explore** page is made up of five main areas: |
| 116 | + |
| 117 | +1. **Dimensions and Metrics** — all fields available on the selected table |
| 118 | +2. **Filters** — restrict the data returned by your query |
| 119 | +3. **Chart** — visualize your query results |
| 120 | +4. **Results** — view the raw data returned from your ClickHouse database |
| 121 | +5. **SQL** — inspect the generated SQL query behind your results |
| 122 | + |
| 123 | +<Image size="lg" img={lightdash_04} alt="Lightdash Explore view showing dimensions, filters, chart, results, and SQL" border /> |
| 124 | + |
| 125 | +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. |
| 126 | + |
| 127 | +For a deeper look at explores and how to query from your tables, see: |
| 128 | +[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) |
| 129 | + |
| 130 | +--- |
| 131 | + |
| 132 | +### Build dashboards {#building-dashboards} |
| 133 | + |
| 134 | +Once you’ve explored your data and saved visualizations, you can combine them into **dashboards** to share with your team. |
| 135 | + |
| 136 | +Dashboards in Lightdash are fully interactive — you can apply filters, add tabs, and view charts powered by real-time ClickHouse queries. |
| 137 | + |
| 138 | +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. |
| 139 | + |
| 140 | +To create a dashboard-only chart: |
| 141 | +1. Click **Add tile** |
| 142 | +2. Select **New chart** |
| 143 | +3. Build your visualization in the chart builder |
| 144 | +4. Save it — it will appear at the bottom of your dashboard |
| 145 | + |
| 146 | +<Image size="lg" img={lightdash_05} alt="Creating and organizing charts within a Lightdash dashboard" border /> |
| 147 | + |
| 148 | +Learn more about how to create and organize dashboards here: |
| 149 | +[Building dashboards → Lightdash Docs](https://docs.lightdash.com/get-started/exploring-data/dashboards?utm_source=clickhouse&utm_medium=partner&utm_campaign=integration_docs) |
| 150 | + |
| 151 | +--- |
| 152 | + |
| 153 | +### Ask AI: self-serve analytics powered by dbt {#ask-ai} |
| 154 | + |
| 155 | +**AI Agents** in Lightdash make data exploration truly self-serve. |
| 156 | +Instead of writing queries, users 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. |
| 157 | + |
| 158 | +It’s powered by the same semantic layer you use in dbt, meaning every answer stays governed, explainable, and fast — all backed by ClickHouse. |
| 159 | + |
| 160 | +<Image size="lg" img={lightdash_06} alt="Lightdash Ask AI interface showing natural language query powered by dbt metrics" border /> |
| 161 | + |
| 162 | +:::tip |
| 163 | +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) |
| 164 | +::: |
| 165 | +</VerticalStepper> |
| 166 | + |
| 167 | +## Learn more {#learn-more} |
| 168 | + |
| 169 | +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). |
0 commit comments