To install OpenTofu on Ubuntu 26.04 LTS or 24.04 LTS, use OpenTofu’s signed APT repository or install the official Snap. Both give you the tofu command. OpenTofu reads configuration files and shows what would change before it creates, updates, or removes resources.
Install OpenTofu on Ubuntu
Verify which OpenTofu you are running
Run your first OpenTofu project
Change the input and clean up
Troubleshoot installation
Update or remove OpenTofu
Frequently asked questions
Why is the APT package called tofu and the Snap called opentofu?
They are package names in different stores. Both install the OpenTofu CLI, which you run with the tofu command.
Can I use OpenTofu without a cloud account?
Yes. A project that uses only terraform_data and local state can run offline after installation. Projects that use remote providers or backends may need network access and credentials.
Does removing OpenTofu delete my infrastructure?
No. Uninstalling the CLI does not act on managed resources or delete configuration and state in your project directory. If you intend to decommission a project, review and destroy its resources before removing OpenTofu.
Helpful Resources
Related Ubuntu guides
- Install and use curl on Ubuntu to understand the downloads used in the APT setup.
- Learn the top Linux commands for working with directories, files and permissions.
Source: OpenTofu’s installation instructions for Debian and Ubuntu.
