Connect ClickHouse to Contextflo

Step-by-step guide to create a read-only ClickHouse user and connect to Contextflo

Last updated: 2/13/2026

Connect your ClickHouse database to Contextflo with a dedicated read-only user.

Prerequisites

  • Admin access to your ClickHouse server
  • ClickHouse HTTP interface enabled (port 8123 or 8443 for HTTPS)

Setup Script

Run this in your ClickHouse client. Update the variables before running.

Loading code sample...

What This Script Does

  1. Creates a dedicated user - contextflo_user with password authentication
  2. Grants read-only access - SELECT permissions on your database

Connection Details for Contextflo

After running the script, use these details to connect:

  • Host: Your ClickHouse server hostname or IP
  • Port: 8123 (HTTP) or 8443 (HTTPS)
  • Protocol: HTTP or HTTPS depending on your setup
  • Database: Your database name (defaults to default)
  • Username: contextflo_user
  • Password: The password you set in the script

ClickHouse Cloud

If you're using ClickHouse Cloud:

  1. Find your hostname in the Cloud console (ends in .clickhouse.cloud)
  2. Use HTTPS protocol with port 8443
  3. Use the credentials from your Cloud service

Verify Permissions

To check what permissions were granted:

Loading code sample...

To test as the new user:

Loading code sample...

Security Notes

  • Read-only access: This setup only grants SELECT permissions. Contextflo cannot modify or delete your data.
  • Password security: Use a secure password with at least 16 characters.
  • Network access: Ensure your ClickHouse server allows connections from Contextflo's IP addresses.

Troubleshooting

Connection Refused

Possible causes:

  • HTTP interface not enabled
  • Firewall blocking port 8123/8443
  • Incorrect host or port

Solutions:

  1. Check that http_port or https_port is configured in your ClickHouse server config
  2. Verify firewall rules allow inbound traffic on the port
  3. Test connectivity: curl http://your-host:8123/ping

Authentication Failed

Possible causes:

  • Wrong username or password
  • User doesn't exist

Solutions:

  1. Double-check credentials
  2. Verify user exists: SELECT name FROM system.users

Permission Denied

Possible causes:

  • User lacks SELECT permissions on the database

Solutions:

Loading code sample...

Next Steps