ClickHouse Connection String Generator
Generate connection strings for ClickHouse in any format. JDBC, .NET, Python, Node.js, Go, and more.
Client-side only — nothing leaves your browser
http://default:@localhost:8123/default
What is a ClickHouse Connection String?
A connection string contains all the information needed to connect to a ClickHouse database: host address, port, database name, credentials, protocol choice, and security settings. Different programming languages and frameworks use different formats. ClickHouse supports both HTTP and Native (TCP) protocols, each with their own default ports and URI schemes.
Protocol Options
- HTTP (8123) — REST-based, works through firewalls and load balancers
- Native/TCP (9000) — Binary protocol with lower latency
- HTTPS (8443) — HTTP with TLS encryption enabled
- Native TLS (9440) — Native protocol with TLS encryption enabled
Quick Reference
| Format | Example Pattern |
|---|---|
| ClickHouse URI (HTTP) | http://user:pass@host:8123/db |
| ClickHouse URI (Native) | clickhouse://user:pass@host:9000/db |
| JDBC (Java) | jdbc:clickhouse://host:8123/db?user=user&password=pass |
| .NET (ClickHouse.Client) | Host=host;Port=8123;Database=db;Username=user;Password=pass;Protocol=http |
| Node.js (@clickhouse/client) | http://user:pass@host:8123/db |
| Python (clickhouse-connect) | clickhouse://user:pass@host:8123/db |
| Go (clickhouse-go) | clickhouse://user:pass@host:9000/db?secure=true |
| PHP (smi2/phpClickHouse) | http://user:pass@host:8123/db |
| DSN | clickhouse://host:9000?database=db&username=user&password=pass |
Frequently Asked Questions
What is a ClickHouse connection string and what format does it use?
A ClickHouse connection string contains all the information needed to connect to a ClickHouse database: host, port, database name, credentials, protocol, and security settings. The format varies by client library. The most common is the URI format (e.g., http://user:pass@host:8123/db), but JDBC, .NET, and language-specific formats each have their own syntax. Our generator supports all major formats.
What is the difference between ClickHouse HTTP and Native (TCP) connection strings?
ClickHouse supports two protocols. HTTP (port 8123) is a stateless, REST-based protocol that works through firewalls and load balancers easily — most client libraries use it by default. Native/TCP (port 9000) is a binary protocol that offers lower latency and is used by the clickhouse-client CLI and some drivers like Go's clickhouse-go. Choose HTTP for broad compatibility and Native for performance-critical applications.
How do I configure SSL/TLS in a ClickHouse connection string?
To enable SSL/TLS, change the protocol scheme and port. For HTTP, switch from http:// (port 8123) to https:// (port 8443). For Native protocol, switch from clickhouse:// (port 9000) to clickhouses:// (port 9440). In JDBC, add ?ssl=true to the connection string. For .NET, set Protocol=https. Most ClickHouse Cloud instances require SSL and use port 8443 by default.
How do I set a connection timeout in a ClickHouse connection string?
Timeout configuration depends on your client library. In JDBC, append ?socket_timeout=300000 (in milliseconds) to the URL. In Node.js (@clickhouse/client), pass request_timeout in the client config. In Python (clickhouse-connect), use the connect_timeout parameter. Our generator adds the timeout parameter in the correct format for each library when you fill in the Timeout field.
How do I build a ClickHouse JDBC connection string for Java?
A ClickHouse JDBC connection string follows the format: jdbc:clickhouse://host:8123/database?user=username&password=pass. The JDBC driver always uses the HTTP protocol. To enable SSL, add &ssl=true and change the port to 8443. You can also append query parameters like &socket_timeout=300000 and &compress=true. Use the official clickhouse-jdbc driver (com.clickhouse:clickhouse-jdbc) for best compatibility.
Need a ClickHouse GUI Client?
1bench is a modern database client for ClickHouse and 20+ other databases. Query, browse, and manage your data visually.
Learn More