Skip to content

Instantly share code, notes, and snippets.

@joshnuss
Last active June 22, 2021 16:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save joshnuss/927da848f5644bb3befad50491cfdd31 to your computer and use it in GitHub Desktop.
Run clickhouse locally and metabase in a docker container
#!/usr/bin bash
# install clickhouse locally
sudo apt install clickhouse-server clickhouse-client
# download latest driver for metabase+clickhouse
mkdir metabase-plugins
wget https://github.com/enqueue/metabase-clickhouse-driver/releases/download/0.7.5/clickhouse.metabase-driver.jar -P metabase-plugins/
# boot container, mapping plugin dir and exposing current host as `host.docker.internal`
docker run -d -p 3000:3000 \
--add-host=host.docker.internal:host-gateway \
--mount type=bind,source=$(pwd)/metabase-plugins,destination=/plugins \
--name metabase metabase/metabase
# open metabase in browser
google-chrome http://localhost:3000
# follow setup wizard
# - choose `clickhouse` as the driver
# - use `host.docker.internal` as the host
@joshnuss
Copy link
Author

To verify connectivity, you can curl clickhouse from the container, and should receive Ok. as a response:

> docker exec -it metabase curl host.docker.internal:8123
Ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment