Sometimes it's way easier to use Linux on a Windows OS. For those who love Ubuntu/Linux and want to work comfortably with Terraform, this post is for you!
One of the reasons I love working with Ubuntu/Linux is because installing software is far easier than on Windows. You only need one line command: sudo apt install, or sudo snap install...
No fuss, no hassle!
Another reason is that Ubuntu Linux is an open-source OS with plenty of capabilities to work with lots of tools, programming languages, etc.
1. Step 1: Head to the Terraform website
Visit Terraform's website and click on 'Download Terraform'.
Step 2: Go to the Linux Tab option
By default, we see Mac OS first on the left-hand side, so choose 'Linux' and copy the first command option with wget -O on your Ubuntu terminal. I assume you have previously installed Ubuntu with wsl --install.
If that does not work, then use: sudo snap install terraform
The reason for using snap is because if you use sudo apt, it will likely print an error such as:
This is because Terraform is available via the snap package manager.
Step 3: Check Terraform installation
Type in your Ubuntu terminal the command: terraform --version
If you successfully get a message with the version of Terraform, then we can be certain that Terraform has been installed.
Important to know: because we are installing Terraform on WSL (Windows Subsystem for Linux), it is not necessary to add its path to the environment system variables which makes sense because we are using wsl.
If you want to install it directly on Windows, then I advise you to use this article from another fellow dev creator: Step by Step guide to installing Terraform on windows
Happy Terraforming!
Top comments (0)