How to Set Up ClickHouse on Windows

Galaxy Glossary

How do I install ClickHouse on Windows 10/11 quickly?

Install and run ClickHouse on Windows via Docker Desktop or the portable build, then connect with clickhouse-client for fast local analytics.

Sign up for the latest in SQL knowledge from the Galaxy Team!
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.

Description

Why run ClickHouse on Windows?

Windows developers want local analytics without spinning up Linux servers. ClickHouse pairs column-store speed with SQL syntax, letting teams prototype dashboards fast on their laptops.

What are the prerequisites for ClickHouse on Windows?

Install Docker Desktop with the WSL 2 backend or enable Hyper-V. Allocate ≥4 GB RAM and 2 CPUs to Docker. Verify PowerShell 5+ is available.

How do I install ClickHouse using Docker Desktop?

Pull the latest image, then start a container that persists data and exposes native and HTTP ports.

docker pull clickhouse/clickhouse-server:latest

docker run -d --name ch_win ^
-p 9000:9000 -p 8123:8123 ^
-v C:\clickhouse\data:/var/lib/clickhouse ^
clickhouse/clickhouse-server:latest

View logs with docker logs -f ch_win; stop and restart using docker stop ch_win / docker start ch_win.

Can I run ClickHouse without Docker?

Yes. Download the portable build from builds.clickhouse.com, unzip to C:\clickhouse, then launch:

cd C:\clickhouse
.\clickhouse-server.exe --config-file=config.xml

The server listens on 9000 (native) and 8123 (HTTP).

How do I connect with clickhouse-client?

For Docker: docker exec -it ch_win clickhouse-client. For the portable build: .\clickhouse-client.exe. Supply --user and --password if you changed defaults.

What sample schema should I test?

Create ecommerce tables to confirm the install:

CREATE TABLE Customers (
id UInt32, name String, email String, created_at DateTime
) ENGINE = MergeTree ORDER BY id;

CREATE TABLE Orders (
id UInt32, customer_id UInt32, order_date Date, total_amount Decimal(10,2)
) ENGINE = MergeTree ORDER BY id;

Best practices for Windows installations

Pin CPU/RAM limits in Docker. Store volumes on SSDs. Avoid exposing ports on public Wi-Fi. Map /var/lib/clickhouse to OneDrive or enterprise storage for backups.

What are common pitfalls?

Low WSL 2 memory causes Cannot allocate memory errors—bump resources in Docker → Settings → Resources. Port conflicts (e.g., SQL Server) block startup—map to free ports with -p 19000:9000.

Why How to Set Up ClickHouse on Windows is important

How to Set Up ClickHouse on Windows Example Usage


-- Calculate customer lifetime value
SELECT c.name,
       SUM(o.total_amount) AS lifetime_value
FROM Orders o
JOIN Customers c ON o.customer_id = c.id
GROUP BY c.name
ORDER BY lifetime_value DESC
LIMIT 10;

How to Set Up ClickHouse on Windows Syntax


PowerShell / CMD syntax:

# Pull latest image
docker pull clickhouse/clickhouse-server[:tag]

# Run container with volume and port mapping
docker run -d --name <container_name> ^
  -p <native_port>:9000 ^
  -p <http_port>:8123 ^
  -v <host_data_path>:/var/lib/clickhouse ^
  clickhouse/clickhouse-server[:tag]

# Connect with client (inside container)
docker exec -it <container_name> clickhouse-client [--user <u>] [--password <p>]

# Portable build launch
.\clickhouse-server.exe --config-file=config.xml

# Example ecommerce table creation
CREATE TABLE Customers (
  id UInt32, name String, email String, created_at DateTime
) ENGINE = MergeTree ORDER BY id;

Common Mistakes

Frequently Asked Questions (FAQs)

Do I need WSL 2 to use ClickHouse on Windows?

WSL 2 is required only for Docker Desktop’s backend. The portable build runs natively without WSL.

How can I upgrade ClickHouse?

Stop the container, pull the new image, and start a new container re-using the same volume. For the portable build, replace binaries and run clickhouse-server --upgrade.

Can I access ClickHouse from TablePlus or Galaxy?

Yes. Use the native port (9000) with the ClickHouse driver or the HTTP port (8123) with an HTTP client. Provide credentials if you enabled authentication.

Want to learn about other SQL terms?

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie
BauHealth Logo
Truvideo Logo
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.