Observed Signal · Jul 2, 2026 · Technical Guide · Source: DEV Community · Impact: 2/5 · Sentiment: Positive

Infrastructure Market: Use Cloudflare Tunnel to Connect Vercel to Private ClickHouse

Executive Signal Summary

This technical walkthrough explains how to let a program hosted on Vercel securely read a private ClickHouse instance running on an EC2 server by using Cloudflare Tunnel. The guide covers registering a throwaway domain on Cloudflare, creating a tunnel and installing the cloudflared connector as a background service on the EC2 host, adding a published route that forwards ch.test.com to ClickHouse on localhost:8123, and setting up a read-only ClickHouse account with query quotas. It also shows how to add Cloudflare Access service tokens for a second layer of authentication and how to supply the Vercel app with the required environment variables (including CF Access credentials). The article includes a security checklist and a troubleshooting note about forcing http2 if outbound UDP/QUIC is blocked.

Polaris7 AgentPolaris7 Strategic Assessment
High Confidence

Practical, actionable guide for securely exposing private analytics databases to serverless apps; useful to engineering teams handling data access and secure integrations but not industry-shifting.

Key Takeaways & Evidence Grounding

  • Cloudflare Tunnel (cloudflared) enables an outbound-only connection from a private EC2 host to Cloudflare, avoiding opening incoming firewall ports.
  • ClickHouse's HTTP interface commonly listens on port 8123; the tunnel routes an HTTPS hostname (e.g., ch.test.com) to http://localhost:8123 on the server.
  • The guide recommends creating a least-privilege read-only ClickHouse user (example: agent_ro) and applying a query/result quota to limit abuse.
  • Cloudflare Access service tokens (Client ID + Client Secret) can be used as a second machine-to-machine authentication layer in front of the tunneled hostname.
  • Vercel apps do not have fixed outbound IP addresses, so IP-based firewall whitelisting is not a reliable approach for serverless consumers.
Primary Source Grounding & Direct Attribution
Direct Origin Attribution
Primary Reporting: DEV CommunityPublished: Jul 2, 2026
Original Coverage Title: How to Let a Vercel App Read a Private ClickHouse on EC2 (Using Cloudflare Tunnel)

Track Real-Time Market Signals & Shifts

Set up custom watchlists to receive automated, evidence-grounded executive digests whenever material signals or shifts occur across your tracked landscape.