dlt, so you can replicate databases, load files, ingest from SaaS, or load from arbitrary REST APIs.
This tutorial shows how to deploy and schedule a pipeline on dltHub to load data into ClickHouse Cloud.
Prerequisites
- Python >=3.11 and uv
- ClickHouse Cloud account
- dltHub account
1
Gather your ClickHouse connection details
To connect to ClickHouse with HTTP(S) you need this information:
Choose HTTPS. Connection details are displayed in an example 
If you’re using self-managed ClickHouse, the connection details are set by your ClickHouse administrator.dlt connects over both the native protocol and HTTP(S), so you also need the native port, which is
The details for your ClickHouse Cloud service are available in the ClickHouse Cloud console.
Select a service and click Connect:

curl command.
9440 (TLS). The HTTPS port is 8443.2
Create a database and a user for dltHub
Connect to ClickHouse with the SQL console and create a database and a dedicated user:
3
Create a dltHub workspace
In an empty directory, run:The command creates a workspace, installs its dependencies with Add the ClickHouse dependencies to the workspace:
uv, signs you in to dltHub, and configures a coding agent. Pick an agent when prompted. You can decline when it offers to launch it, because this tutorial doesn’t need one.To add dltHub to an existing dlt project instead, run
uvx dlthub-init@latest. See Install dltHub.4
Add a pipeline
The workspace comes with a sample pipeline. Replace the contents of The pipeline loads only issues and commits updated since
pipeline.py with a pipeline that loads issues and commits from the GitHub REST API for the ClickHouse/ClickHouse repository every hour:initial_value, then continues from the last cursor value on each run. Adjust initial_value to a recent date to keep the first load small. The GitHub API allows 60 unauthenticated requests per hour, and each page of 100 records is one request. See GitHub rate limits.The trigger schedules the job with a cron expression. See triggers and scheduling for cron, intervals and follow-up jobs.Then replace the contents of __deployment__.py to register the pipeline as a job that dltHub can deploy:5
Set the ClickHouse credentials on dltHub
dlt reads destination credentials from environment variables. Store them as workspace variables on dltHub, which injects them into every run. Secret values are write-only and never shown again.The last command reads the password from stdin, so it doesn’t end up in your shell history.
6
Deploy and run the pipeline
Deploy the workspace to dltHub. This syncs your code, registers the job and starts its hourly schedule:Run the job right away and follow its logs until it finishes:To open the run and the workspace in the dltHub web app at app.dlthub.com, run:
7
Verify the data in ClickHouse
You can use the web UI or the ClickHouse has no concept of a dataset, so dlt prefixes the table names with the dataset name (A
clickhousectl CLI to check the loaded data. Authenticate once with clickhousectl cloud auth login, then list the tables:github_data) and the separator ___. dlt flattens nested objects into columns such as user__login and commit__author__name, and unpacks nested lists into child tables such as issues__labels and commits__parents. The _dlt_* tables hold dlt’s own metadata about loads, pipeline state and schema versions. See Datasets in the dlt documentation.Check the status of the loads and the row count:status of 0 means the load completed successfully.Next steps
- Replace the GitHub source with your own. Ask your coding agent to build one with the dltHub AI Harness, or use the
rest_api,sql_databaseorfilesystemsources from dlt. - Use dltHub Ontology to generate business context as data loads, for use by your ClickHouse agents.