Skip to main content

Installing OpenTofu on Alpine Linux

OpenTofu is available in the Alpine Linux testing repository or as an .apk package from the GitHub releases page.

Installing using the installer

You can use the OpenTofu installer script to run the installation.

# Download the installer script:
curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.sh -o install-opentofu.sh
# Alternatively: wget --secure-protocol=TLSv1_2 --https-only https://get.opentofu.org/install-opentofu.sh -O install-opentofu.sh

# Give it execution permissions:
chmod +x install-opentofu.sh

# Please inspect the downloaded script

# Run the installer:
./install-opentofu.sh --install-method apk

# Remove the installer:
rm install-opentofu.sh

Installing the .apk

You can also download the .apk and install it on your Alpine Linux. You can install the .apk package after downloading it:

apk add --allow-untrusted tofu_*.apk

Installing from the testing repository

OpenTofu is currently available in the Alpine Testing repository and coming to Alpine stable. You can use the following commands to test Alpine installation.

echo '@community https://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories
apk add opentofu@community