# How to Install OpenTofu

> Install OpenTofu on Ubuntu with the official installer script or manually from the GitHub releases, check the installation and upgrade it.

- Source: https://www.itwonderlab.com/how-to-install-opentofu/
- Published: 2023-11-06
- Updated: 2026-10-05
- Author: Javier Ruiz Jiménez (https://www.javierruizjimenez.com/)
- Site: IT Wonder Lab (https://www.itwonderlab.com/)

---

Previously named OpenTF, OpenTofu is an open-source, community-driven fork of [Terraform](https://www.itwonderlab.com/tutorials/terraform/) managed by the Linux Foundation. It uses the same [HCL](https://www.itwonderlab.com/hcl/) language and works with the same providers and modules.

OpenTofu can be installed on several operating systems [using a package manager](https://opentofu.org/docs/intro/install/) or by downloading a package from the OpenTofu GitHub Releases repository. This tutorial shows how to install it on Ubuntu. For other operating systems, see the [official documentation](https://opentofu.org/docs/intro/install/).

### Install OpenTofu with the installer script

The installer script of the OpenTofu project detects the operating system, adds the OpenTofu repository and installs the package. Download it, read it, and run it:

```shell
$ curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.sh -o install-opentofu.sh
$ chmod +x install-opentofu.sh
$ less install-opentofu.sh
$ ./install-opentofu.sh --install-method deb
$ rm -f install-opentofu.sh
```

Because the repository is added to the system, OpenTofu is upgraded with the rest of the packages (`sudo apt update && sudo apt upgrade`).

### Install OpenTofu manually from the GitHub releases

1. Visit the [OpenTofu GitHub Releases](https://github.com/opentofu/opentofu/releases) page, expand the list of assets and identify the package for your architecture, for example `tofu_<version>_amd64.deb` for Ubuntu on AMD/Intel 64 bits or `tofu_<version>_arm64.deb` for ARM.
2. Download the package with `wget`:

   ```shell
   $ wget https://github.com/opentofu/opentofu/releases/download/v<version>/tofu_<version>_amd64.deb
   ```

3. Install it with `dpkg`:

   ```shell
   $ sudo dpkg --install tofu_<version>_amd64.deb
   ```

### Test the OpenTofu installation

```shell
$ tofu version
OpenTofu v1.x.x
on linux_amd64
```

### Upgrade OpenTofu

Install the new version using the same method. Then run `tofu init -upgrade` in your projects to update the providers inside the version constraints. If the backend configuration has changed, run a state migration:

```shell
$ tofu init
Initializing the backend...
...
$ tofu init -migrate-state
```

To use different versions of OpenTofu in different projects, see [tenv](https://www.itwonderlab.com/aws-terraform-tutorial-terraform-tools/) in the Terraform Tools section.

### Next Steps

-   [Migrate from Terraform to OpenTofu](https://www.itwonderlab.com/terraform-to-opentofu/)
-   [AWS with Terraform: The Essential Guide (1/21) – Terraform Basics](https://www.itwonderlab.com/aws-terraform-tutorial-terraform-basics/)
