There are a few ways to set up dbt in your local machine, and almost all of them involves Docker in one or the other way. I found the easiest and most straight forward way to install it on your system is using HashiQube. HashiQube is a project to help anyone set up all HashiCorp products in a container or virtual machine (VM) for demo or trial purposes.
As I told above, Hashiqube depends on Docker to set up dbt
in a local machine, but it also requires Vagrant (a tool from HashiCorp) to install it. So, you need to start with downloading and installing these tools as detailed below:
git
in your system, run git clone https://github.com/servian/hashiqube.git
. If you have not, then download the archived repo from https://github.com/servian/hashiqube/archive/refs/heads/master.zip
.1cd dbt
2vagrant up --provision-with basetools,docsify,docker,postgresql,dbt
1. I see this error: /vagrant/dbt/common.sh: line 2: $'\r': command not found
.
This occurs if you’re trying to set up dbt on Windows. Run these commands, then continue from Step #4 above:
1cd ..
2del .\hashiqube
3
4# Configure Git to not ensure line endings are correct for Windows at checkout
5# That means line endings will remain at Unix style, which fixes this problem
6git config --global core.autocrlf false
7
8# Clone the repo again to checkout files with line endings using Unix style
9git clone https://github.com/servian/hashiqube.git
10
11# Configure Git again to ensure line endings are correct for Windows at checkout
12git config --global core.autocrlf true
2. I don’t know what to expect after running the vagrant up
command given above.
Please find here the output of this command on Windows (yours may vary per your operating system).
Get in touch to discuss an idea or project. We can work together to make it live! Or enquire about writing guest posts or speaking in meetups or workshops.