# Set Up a Linux CLI Environment on Windows

Source: https://docs.quake.ai/docs/tools/windows-cli-environment
Markdown: https://docs.quake.ai/docs/tools/windows-cli-environment.md

---

# Set up a Linux CLI environment on Windows

The CLI examples throughout this documentation use `bash`, the default shell on Linux and macOS. If your local machine runs Windows, you need a Linux-compatible shell environment before following CLI, API, or Terraform guides.

This page covers four approaches. Pick the one that fits your workflow, then return to the guide you were reading.

## Quick comparison

| Approach | Best for | Setup time | Limitations |
|---|---|---|---|
| [WSL 2](#wsl-2-recommended) | Most users: full Linux on Windows | 5–10 min | Requires Windows 10 1903+ or Windows 11 |
| [Git Bash](#git-bash) | Quick CLI tasks when Git is already installed | 2–5 min | No package manager, limited GNU tools |
| [Docker Desktop](#docker-desktop) | Teams standardizing on containers | 10–15 min | Licensing requirements for large organizations |
| [Quake AI VM](#ssh-into-a-quake-ai-vm) | Existing customers who want a persistent remote environment | 5 min | Requires a Quake AI account and internet connection |

## WSL 2 (recommended)

Windows Subsystem for Linux (WSL 2) runs a full Linux kernel inside Windows. After setup, you open a terminal and work in Ubuntu exactly as the docs describe: `bash`, `apt`, `curl`, `ssh`, `pip`, and `brew` all work natively.

### Install WSL

Open **PowerShell** as Administrator and run:

```bash
wsl --install
```

This installs WSL 2 with Ubuntu as the default distribution. Restart your machine when prompted.

For detailed instructions and troubleshooting, see the [Microsoft WSL installation guide](https://learn.microsoft.com/en-us/windows/wsl/install).

### Open your Linux shell

After restarting, open the **Ubuntu** app from the Start menu (or type `wsl` in any terminal). You are now in a `bash` shell.

### Install CLI tools

From inside your WSL terminal, install the tools used in Quake AI guides:

```bash
sudo apt update && sudo apt install -y python3 python3-pip curl
```

Install the OpenStack CLI:

```bash
pip3 install python-openstackclient
```

Install OpenTofu (for IaC guides):

```bash
curl -fsSL https://get.opentofu.org/install-opentofu.sh | sh -s -- --install-method standalone
```

### Verify

```bash
bash --version
openstack --version
tofu --version
```



If you use VS Code, install the [Remote - WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl). It lets you edit files and run terminals inside your WSL environment directly from VS Code.



## Git bash

[Git for Windows](https://gitforwindows.org/) bundles Git Bash, a minimal `bash` environment with `curl`, `ssh`, `grep`, `awk`, and other common Unix utilities. If you already have Git installed, Git Bash is ready to use.

### Install

Download and run the installer from [gitforwindows.org](https://gitforwindows.org/). Accept the defaults.

### Limitations

Git Bash does not include a package manager (`apt`, `brew`). You cannot install the OpenStack CLI or OpenTofu directly inside Git Bash. Use Git Bash for guides that only require `bash`, `curl`, `ssh`, or `git`. For anything that needs package installation, use WSL 2 instead.

### Verify (git bash)

Open **Git Bash** from the Start menu and run:

```bash
bash --version
curl --version
ssh -V
```

## Docker desktop

If you already use Docker, you can run CLI tools inside a Linux container without modifying your Windows environment.

### Install (Docker desktop)

Download [Docker Desktop for Windows](https://www.docker.com/products/docker-desktop/) and complete the installation. Docker Desktop requires WSL 2 as its backend on modern Windows; the installer enables it automatically.



Docker Desktop is free for personal use, education, and small businesses below Docker's published employee and revenue thresholds. Larger organizations require a paid subscription. See the [Docker pricing page](https://www.docker.com/pricing/) for current thresholds and terms.



### Run a Linux shell with CLI tools

Start an Ubuntu container with your project files mounted:

```bash
docker run -it --rm -v "%cd%":/work -w /work ubuntu:24.04 bash
```

Inside the container, install the tools you need:

```bash
apt update && apt install -y python3 python3-pip curl
pip3 install python-openstackclient
```

### Verify (Docker desktop)

```bash
bash --version
openstack --version
```

When you exit the container, installed tools are lost. To avoid reinstalling each time, create a Dockerfile with your tools pre-installed, or use a named volume.

## SSH into a Quake AI VM

If you have a Quake AI account, you can create a Linux VM and SSH into it from Windows. This gives you a full native Linux environment with no local setup beyond an SSH client (built into Windows 10+).

### Create a VM

Follow the [Quickstart](/docs/quickstart#3-launch-your-first-server) to create an Ubuntu instance on the Developer plan.

### Connect via SSH

Open **PowerShell** or **Windows Terminal** and connect:

```bash
ssh ubuntu@YOUR_VM_IP
```

Replace `YOUR_VM_IP` with the floating IP assigned to your instance.

### Install CLI tools (SSH into a Quake AI VM)

Once connected, you are on a standard Ubuntu machine. Install tools as described in the WSL 2 section above:

```bash
sudo apt update && sudo apt install -y python3 python3-pip curl
pip3 install python-openstackclient
curl -fsSL https://get.opentofu.org/install-opentofu.sh | sh -s -- --install-method standalone
```

### Verify (SSH into a Quake AI VM)

```bash
openstack --version
tofu --version
```



Unlike WSL or Docker, a Quake AI VM persists between sessions. Tools stay installed, files stay on disk, and your `openrc.sh` credentials remain sourced until you destroy the instance. This makes it a good option for ongoing IaC work.



## Next steps

- [Install OpenStack client](/docs/tools/install-openstack-client): detailed CLI setup
- [Add an SSH key pair](/docs/tools/add-ssh-key): generate and upload keys (includes Windows-specific instructions)
- [Automate your infrastructure with OpenTofu](/docs/quickstart/automate-infrastructure-opentofu): provision infrastructure with OpenTofu
- [Create application credentials](/docs/tools/generate-app-credentials): authenticate your CLI environment
