Skip to main content
All quickstarts
Real-Time AnalyticsData WarehousingObservabilityAI/MLCloud

Prerequisites

You should also have completed the following quickstarts:

What you’ll build

In this quickstart you’ll use clickhouse-client - the official ClickHouse CLI client - to insert data from a local CSV file into a ClickHouse Cloud service. You’ll install clickhouse-client, prepare a sample dataset, connect to your Cloud service, create a table, and insert data from your local machine. By the end, you’ll know how to use clickhouse-client to load local files into ClickHouse Cloud, a workflow that works with CSV, Parquet, JSON, and many other formats.
1

Install clickhouse-client

clickhouse-client is the official CLI for connecting to ClickHouse. It is included in the ClickHouse binary.Install it using the universal installer:
This downloads the latest clickhouse binary into your current directory. Verify the installation:
You should see output showing the ClickHouse version number, confirming clickhouse-client is ready to use.
2

Prepare a sample CSV file

Create a small sample CSV file so this quickstart is self-contained. Run the following in your terminal:
3

Connect to your Cloud service

The commands below assume you’ve exported CLICKHOUSE_HOST, CLICKHOUSE_USER, and CLICKHOUSE_PASSWORD as environment variables, as described in the Obtain your Cloud connection details quickstart. If you haven’t, you can replace them with your values directly.Test connectivity by running a simple query against your Cloud service:
If the connection succeeds you’ll see 1 printed to the terminal. If you get a connection error, check that your service is awake in the Cloud console and that your hostname and password are correct.
Port 9440 is the secure native protocol port for ClickHouse Cloud. The --secure flag enables TLS encryption. These are required for all Cloud connections.
4

Create a target table and insert data

First, create a table on your Cloud service to receive the data:
Now insert the data from your local CSV file. This is the key step - clickhouse-client reads the file from stdin and streams it to the remote service:
clickhouse-client sends the contents of the CSV file directly to your Cloud service. The CSVWithNames format tells ClickHouse that the first row contains column headers.
5

Verify the data was inserted

Query your Cloud service to confirm the rows arrived:
You should see 10 - the number of rows in the sample CSV.Preview the data:
This same workflow works with Parquet, TSV, JSON, Avro, ORC, and many other supported formats - just change the FORMAT clause and pipe in the appropriate file.

Next steps

In this quickstart you installed clickhouse-client, connected it to a ClickHouse Cloud service, and used it to stream data from a local CSV file into the Cloud. This same approach works for Parquet, JSON, and dozens of other formats. Check out the following quickstarts next: Or go deeper with the reference documentation:
ClickHouse Academy — Master ClickHouse with expert-designed training for every skill level

Check out the ClickHouse academy for on-demand and live training

Last modified on June 23, 2026