lightdash deploy pushes your local dbt or native Lightdash YAML models to Lightdash.
Use it to publish local changes, or use lightdash refresh to compile the files already committed to your connected repository. For native models, follow the Lightdash YAML deployment steps; the profiles and targets in the CLI examples below apply to dbt.
Before you deploy: A quick word of caution
For a safer, scalable approach to deploying and previewing changes, use CI/CD. This allows you to:- Spin up Lightdash preview environments for each PR
- Deploy production changes consistently using shared, secure credentials
- Avoid accidentally pointing to the wrong target in your local profile
Option 1: Deploy via the CLI
Basic usage:- Use your local dbt profile for the connection
- Push the current state of your local dbt project files (including uncommitted changes or code from your active branch) to the authenticated Lightdash project
- Trigger a re-compile and refresh of your Lightdash project
lightdash deploy compiles every model in your dbt project, and a model with no columns in its YAML shows up as an errored explore reporting No dimensions available. To deploy only the models you use in Lightdash, for example when your project also contains upstream models you don’t query, pass --select, --exclude or --selector. lightdash preview and lightdash start-preview take the same flags. See dbt node selection.
Use strict compilation
Lightdash uses partial compilation by default. Field, join, and set-validation failures that can be isolated are reported as warnings so the rest of the explore stays usable; failures that cannot be isolated can still produce errors. Add--no-partial-compilation to report the failures that partial compilation would otherwise isolate as errors instead. It doesn’t promote unrelated, non-blocking warnings — other generic compilation warnings stay non-blocking.
If your project uses physical column references such as ${TABLE}.order_id, add --validate-warehouse-columns to check supported unquoted references with warehouse queries that return no rows. It’s opt-in because it sends those queries; whether your warehouse scans or bills for them is warehouse-dependent, and the check needs warehouse credentials and the warehouse catalog. Warehouse-column errors are reported whether partial compilation is on or off.
See the CLI compilation options for the supported reference syntax and every skip condition.
For the strictest deploy, combine both flags:
--ignore-errors with this strict CI pattern — --ignore-errors lets a deployment continue after compilation errors, which defeats the check.
Troubleshoot warehouse connection errors
To read column types from the warehouse catalog,lightdash deploy connects to your warehouse directly from the machine running the CLI, such as your laptop or a CI runner, using the credentials in your profiles.yml. A warehouse connection timeout during deploy, such as Connection terminated due to connection timeout, means that machine can’t reach the warehouse. Check its network path: VPN, firewall, or the warehouse’s IP allowlist. lightdash diagnostics doesn’t test this connection, so it can pass while deploy fails.
To deploy without connecting for the catalog, add --skip-warehouse-catalog. Lightdash then uses the column types declared in your YAML.
Option 2: Safely refresh metadata using lightdash refresh
To pull committed changes from the configured branch of your project’s Git repository, run:
- Uses the connection saved in Lightdash
- Compiles the repository using the project’s selected semantic layer format
- Leaves your local files and dbt profile out of the refresh
lightdash refresh.
