# Connecting local docker ksqldb cli to ConfluentCloud hosted cluster

**URL:** <https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486>\
**Category:** Confluent Cloud\
**Created:** [12 August 2021 15:13 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486 "2021-08-12T15:13:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![georgelza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/georgelza/32/3026_2.png) [@georgelza](https://forum.confluent.io/u/georgelza)\
**Post date:** [12 August 2021 15:13 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/1 "2021-08-12T15:13:28Z")

</div>

Hi guys

So I’ve done the first, got ccloud working, I’ve got Robin’s ais app into a AWS hosted EC2 pod hosting a docker environment, it’s consuming and pushing successfully to my Confluent Cloud cluster/topic.

Now want to get ksqldb cli working on my MAC… hitting wall.

Can someone maybe share what needs to be set, how.

G

---

<div class="post-metadata">

**Author:** ![mmuehlbeyer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mmuehlbeyer/32/1088_2.png) [@mmuehlbeyer](https://forum.confluent.io/u/mmuehlbeyer)\
**Post date:** [13 August 2021 06:16 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/2 "2021-08-13T06:16:49Z")

</div>

Hi,

a good point to start:

[https://docs.confluent.io/cloud/current/cp-component/ksql-cloud-config.html](https://docs.confluent.io/cloud/current/cp-component/ksql-cloud-config.html)  
[https://docs.confluent.io/cloud/current/cp-component/ksqldb-ccloud-cli.html](https://docs.confluent.io/cloud/current/cp-component/ksqldb-ccloud-cli.html)

full cloud etl example  
[https://docs.confluent.io/platform/current/tutorials/examples/cloud-etl/docs/index.html#](https://docs.confluent.io/platform/current/tutorials/examples/cloud-etl/docs/index.html#)

HTH,  
M

---

<div class="post-metadata">

**Author:** ![georgelza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/georgelza/32/3026_2.png) [@georgelza](https://forum.confluent.io/u/georgelza)\
**Post date:** [13 August 2021 13:24 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/3 "2021-08-13T13:24:25Z")

</div>

must be missing something, the first url seem to tell me how to configure ksqldb to talk to my Confluent cluster … - this i was doing via the web interface.  
The second url seems to configure ccloud how to connect to the ksqldb cluster, to manage it…

neither seem to enable/configure ksqldb cli, where I can run the relevant sql.

G

---

<div class="post-metadata">

**Author:** ![mmuehlbeyer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mmuehlbeyer/32/1088_2.png) [@mmuehlbeyer](https://forum.confluent.io/u/mmuehlbeyer)\
**Post date:** [13 August 2021 14:27 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/4 "2021-08-13T14:27:53Z")

</div>

I think there is a solution

@rmoff blogged about it some months ago

> **[Connecting to managed ksqlDB in Confluent Cloud with REST and ksqlDB CLI](https://rmoff.net/2021/03/24/connecting-to-managed-ksqldb-in-confluent-cloud-with-rest-and-ksqldb-cli/)**

basically it seems to work with

```auto
docker run --interactive --tty --rm \
  confluentinc/ksqldb-server:0.15.0 \
  ksql -u $CCLOUD_KSQL_API_KEY \
       -p $CCLOUD_KSQL_API_SECRET \
          $CCLOUD_KSQL_ENDPOINT

```

code snippet taken from above blog post (credits to Robin)

Michael

---

<div class="post-metadata">

**Author:** ![georgelza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/georgelza/32/3026_2.png) [@georgelza](https://forum.confluent.io/u/georgelza)\
**Post date:** [13 August 2021 15:18 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/5 "2021-08-13T15:18:03Z")

</div>

thanks, will go have a read and report back.

G

---

<div class="post-metadata">

**Author:** ![georgelza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/georgelza/32/3026_2.png) [@georgelza](https://forum.confluent.io/u/georgelza)\
**Post date:** [13 August 2021 18:10 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/6 "2021-08-13T18:10:28Z")

</div>

trying to wok through the how to…  
but it talks of a $0.88 cost.hour, adding up to $640/month…

well that does not fit well into the voucher amount…

hows everyone else doing these demo’s at these rates.

\<really need a demo type cluster that say only allows 1 week’s retention, max 10GB, all features enabled, zero cost, never production\>

G

---

<div class="post-metadata">

**Author:** ![georgelza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/georgelza/32/3026_2.png) [@georgelza](https://forum.confluent.io/u/georgelza)\
**Post date:** [16 August 2021 13:06 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/7 "2021-08-16T13:06:11Z")

</div>

anyone have clarity on this?  
G

---

<div class="post-metadata">

**Author:** ![mmuehlbeyer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mmuehlbeyer/32/1088_2.png) [@mmuehlbeyer](https://forum.confluent.io/u/mmuehlbeyer)\
**Post date:** [16 August 2021 13:13 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/8 "2021-08-16T13:13:39Z")

</div>

you’re talking about demos clusters?

---

<div class="post-metadata">

**Author:** ![georgelza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/georgelza/32/3026_2.png) [@georgelza](https://forum.confluent.io/u/georgelza)\
**Post date:** [16 August 2021 13:18 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/9 "2021-08-16T13:18:07Z")

</div>

yes, where there is a zero cost.

Question, when we currently create a confluent cluster, using the vouchers, how do we shut the cluster down.

G

---

<div class="post-metadata">

**Author:** ![georgelza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/georgelza/32/3026_2.png) [@georgelza](https://forum.confluent.io/u/georgelza)\
**Post date:** [16 August 2021 13:28 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/10 "2021-08-16T13:28:00Z")

</div>

and then back to cost management.

if we go and create that small standard cluster, and allocate to it the voucher to not pay for it, we now need a ksqldb, and I noticed it’s a $0.88 cost/hour, which rolls up to $688/month.  
Not fitting into the voucher. so how do we realistically manage this.

Or MY suggest Confluent might rather create a Demo/education cluster, where nothing is charged, with small enough limits to prohibit production usage.

G

---

<div class="post-metadata">

**Author:** ![mmuehlbeyer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mmuehlbeyer/32/1088_2.png) [@mmuehlbeyer](https://forum.confluent.io/u/mmuehlbeyer)\
**Post date:** [17 August 2021 06:03 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/11 "2021-08-17T06:03:12Z")

</div>

afaik there is no possibility to shutdown the cluster  
only delete is possible

---

<div class="post-metadata">

**Author:** ![mmuehlbeyer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mmuehlbeyer/32/1088_2.png) [@mmuehlbeyer](https://forum.confluent.io/u/mmuehlbeyer)\
**Post date:** [17 August 2021 06:06 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/12 "2021-08-17T06:06:42Z")

</div>

I think it depends a little on your use and test case

is it necessary to have the cluster running for a whole month for test/demo cases?

if not you might create some deployment scripts to easily recreate kafka topics and so on and delete the cluster after every test

---

<div class="post-metadata">

**Author:** ![georgelza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/georgelza/32/3026_2.png) [@georgelza](https://forum.confluent.io/u/georgelza)\
**Post date:** [17 August 2021 08:26 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/13 "2021-08-17T08:26:30Z")

</div>

… this is all learning/teach myself Kafka, KSQLDB etc.

via personal Python and Golang programs and then following Robin’s Blogs.

G

---

<div class="post-metadata">

**Author:** ![georgelza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/georgelza/32/3026_2.png) [@georgelza](https://forum.confluent.io/u/georgelza)\
**Post date:** [17 August 2021 08:28 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/14 "2021-08-17T08:28:12Z")

</div>

Are you aware of a screen where your invoice/billing is visible, where you could see what the current usage/$$$ of the voucher is sitting at?

G

---

<div class="post-metadata">

**Author:** ![georgelza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/georgelza/32/3026_2.png) [@georgelza](https://forum.confluent.io/u/georgelza)\
**Post date:** [17 August 2021 08:29 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/15 "2021-08-17T08:29:01Z")

</div>

ignore, found it, Billing and payment

G

---

<div class="post-metadata">

**Author:** ![mmuehlbeyer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mmuehlbeyer/32/1088_2.png) [@mmuehlbeyer](https://forum.confluent.io/u/mmuehlbeyer)\
**Post date:** [17 August 2021 08:29 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/16 "2021-08-17T08:29:45Z")

</div>

ok I see  
but what about a small local demo env based on docker?

---

<div class="post-metadata">

**Author:** ![georgelza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/georgelza/32/3026_2.png) [@georgelza](https://forum.confluent.io/u/georgelza)\
**Post date:** [17 August 2021 08:32 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/17 "2021-08-17T08:32:38Z")

</div>

that is a option, can can investigate… just thinking, everyone is trying to learn the stack, Confluent gives us these vouchers, but then we sitting with situation if we enable something like ksqldb it will eat about 3x the voucher price.

most people doing these demo/blog examples I can promise you is not thining/noticing that $0.88/hour amount, rolling up to $688/month.

They would all come in, enable the bits and do the demo, done with first, by that time Robin prob release another great demo that has to be tried,

and come end of the month, whammy… knockout, as that $$$ goes of your personal CC.

G

---

<div class="post-metadata">

**Author:** ![georgelza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/georgelza/32/3026_2.png) [@georgelza](https://forum.confluent.io/u/georgelza)\
**Post date:** [17 August 2021 08:47 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/18 "2021-08-17T08:47:40Z")

</div>

… my local band width is also not that great, but might be the best/cost effective/risk free option.

G

---

<div class="post-metadata">

**Author:** ![georgelza](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/georgelza/32/3026_2.png) [@georgelza](https://forum.confluent.io/u/georgelza)\
**Post date:** [17 August 2021 14:05 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/19 "2021-08-17T14:05:16Z")

</div>

back to the local cluster idea…

One of the attractive reasons to use the cloud based confluent platform is the pre configured/availability of the connectors to sites like Elastic…

G

---

<div class="post-metadata">

**Author:** ![mmuehlbeyer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mmuehlbeyer/32/1088_2.png) [@mmuehlbeyer](https://forum.confluent.io/u/mmuehlbeyer)\
**Post date:** [18 August 2021 06:22 UTC](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486/20 "2021-08-18T06:22:01Z")

</div>

understand and agree  
so maybe a split dev environment might be a good way to go

for example:

**part 1 local dev env**  
based on confluent quickstart

> **[Quick Start for Confluent Platform | Confluent Documentation](https://docs.confluent.io/platform/current/quickstart/ce-docker-quickstart.html)**
>
> Install Confluent and build a real-time Kafka app with streaming data and SQL.

**part 2 cloud dev env**  
cloud environment based on confluent cloud  
only started when needed, shutdown/deleted after usage  
prepare deploy scripts to easy built-up a new cluster

just my thoughts to omit huge costst

M

[Next page](https://forum.confluent.io/t/connecting-local-docker-ksqldb-cli-to-confluentcloud-hosted-cluster/2486.md?page=2)
