How to Deploy ClickHouse Data Warehouse Locally on Mac
If you are looking for a very low-cost alternative Data Warehouse to Snowflake, Firebolt, Redshift, or Big Query, Open-Source Clickhouse could be a great choice.
In this blog post, I will be using Docker, Inc to deploy ClickHouse locally.
Paste all the following commands in your mac terminal
Note - This blog post assumes that you have Docker installed on your Mac.
Step 1: Pulling the container from the Docker Hub
By executing the above command we pull the official Clickhouse image from Docker hub
Step 2: Configure a new admin user for Clickhouse
To access the Clickhouse server we need a username and password. In order to create a new user and password we have to draft a newuser.xml which looks like the following
The above XML file tells ClickHouse to create a user name called chris and chris can use a password to access Clickhouse from certain networks. It also tells Clickhouse that chris can change the access of other users. This piece is very important because you can use this security policy to create other users.
Step 3: Running the ClickHouse Server Container locally
Above command
Runs the image we just downloaded
On HTTP port 18123
Moves the newuser.xml from the desktop to a specific place inside Docker
Names the Docker container as local-clickhouse-server
Creates a container id as the output
Step 4: Create a ClickHouse Database via Docker
Run the above command to get into the Clickhouse server via the client. Once you are in the server type the following commands
Your database named test should be created and displayed on your terminal.
Step 5: Open a SQL GUI like Datagrip and plug in the following parameters
The parameters mentioned above were created by you when you ran the Docker container and plugged in the newuser.xml file.
In less than three minutes your local data warehouse is ready. You should be able to create tables and query them at blazing-fast speed.
If you have any questions reach me at [email protected]