Skip to main content
⏳ Estimated read time: 6 min read

Install StackGen CLI

This guide covers both installing and uninstalling the StackGen CLI on different operating systems.

InstallInstall DependenciesUninstall

Install

To install StackGen CLI, follow the appropriate method based on your operating system:

macOS

Click to view

Install Homebrew if not already installed by running:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install StackGen:

brew install stackgenhq/stackgen/stackgen

Verify the Installation:

stackgen version

Updating StackGen CLI on macOS

Update StackGen CLI using:

brew upgrade stackgen

You can verify the updated version with:

stackgen version

Linux

Click to view

Follow these steps to install StackGen using Homebrew on your Linux system.

  1. Install Git: Git is required for Homebrew and StackGen.

    sudo yum install git -y
  2. Install Homebrew: Homebrew is a package manager that simplifies software installation. Set up the environment path:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  3. Configure Homebrew for Your Shell: Add Homebrew to your shell’s environment variables. If you’re using a different shell like zsh or fish, replace .bashrc accordingly.

    echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
  4. Apply the Changes: Reload your shell configuration so the new settings take effect.

    source ~/.bashrc
  5. Install StackGen: Now use Homebrew to install StackGen.

    brew install stackgenhq/stackgen/stackgen

Update StackGen CLI on Linux

Update StackGen CLI using:

brew upgrade stackgen

You can verify the updated version with:

stackgen --version

Windows

StackGen CLI can be used on Windows in the following ways:

Option 1: Using Docker

Click to view

StackGen CLI runs on Windows using Docker. To start a StackGen CLI container, use the following command:

docker run -it --rm -p 50525:50525 -v ~/.stackgen:/home/stackgen/.stackgen ghcr.io/stackgenhq/stackgen:latest
note

This command launches a temporary StackGen CLI container, switching the terminal prompt to the StackGen CLI environment where StackGen commands can be executed.

Updating StackGen CLI with Docker

If you're using the Docker-based CLI, pull the latest image:

docker pull ghcr.io/stackgenhq/stackgen:latest

Then run the CLI as usual:

docker run -it --rm -p 50525:50525 -v ~/.stackgen:/home/stackgen/.stackgen ghcr.io/stackgenhq/stackgen:latest

Option 2: Using Windows Subsystem for Linux (WSL)

Click to view

Alternatively, users can install WSL and run the StackGen CLI using the Linux installation steps. This approach allows for a native Linux environment within Windows.

  1. Install WSL and a Linux distribution (e.g., Ubuntu) by following the WSL installation guide.
  2. Open WSL and follow the Linux installation steps above.

Updating StackGen CLI with WSL

If you're using WSL with Homebrew, follow the same upgrade command as Linux/macOS:

brew upgrade stackgen

You can verify the updated version with:

stackgen version

Option 3: Using .exe File

Click to view
  1. Install Terraform: Check if you’ve installed Terraform by running the following command:

    terraform version

    To install Terraform, run the following command:

    tip

    We recommend that you use Chocolatey for installing Terraform on Windows.

    If you have Chocolatey installed, run:

    choco install terraform

    If you don’t have Chocolatey, install it from chocolatey.org.

  2. Downlodad stackgen.exe: To Download the .exe file, click the link https://releases.stackgen.com/binaries/v0.69.0/stackgen-cli_0.69.0_windows_amd64.zip.

  3. Set up StackGen CLI using .exe: To use the StackGen CLI on Windows, add the folder containing the .exe file to your System Environment Variables under the Path variable. This lets you to run the Cloud-to-Code CLI directly from the terminal window. Follow these steps to set up the StackGen CLI:

    1. Extract the contents of the .zip file and save the executable (.exe) files in a folder you want to add to your system PATH.

    2. Open Start and search for Edit the system environment variables, and then open it.

    3. In the System Properties window, click Environment Variables.

    4. Under User variables, find and select the Path variable, then click Edit.

    5. In the Edit Environment Variable window, click New.

    6. Paste the full folder path where the .exe file is stored (e.g., C:\Tools\stackgen), then click OK to save.

    7. Restart your terminal and run the Cloud-to-Code CLI to confirm it works:

      stackgen --version

Update StackGen CLI

To update your StackGen CLI with the latest version, run the following command:

If you have Chocolatey installed, run:

choco upgrade stackgen 

If you don’t have Chocolatey, install it from chocolatey.org.

Install StackGen CLI Dependencies

Click to view

You will need to install the following before you provision or deploy your appStacks:

Uninstall

Click to view

If you need to uninstall StackGen CLI from your system, follow the appropriate instructions for your operating system:

macOS

To uninstall StackGen CLI from macOS:

brew uninstall stackgen

Linux

To uninstall StackGen CLI from Linux:

brew uninstall stackgen

Windows

From Docker

If you've been using StackGen CLI with Docker, there's no formal uninstallation needed as each container is temporary.

To remove the Docker image:

docker rmi ghcr.io/stackgenhq/stackgen:latest

You can also remove any related Docker volumes if desired:

docker volume prune

From WSL

To uninstall StackGen CLI from Windows Subsystem for Linux:

  1. Open your WSL terminal
  2. Run the same uninstall command as Linux:
brew uninstall stackgen