Terraform Code Generator for Ubuntu

Generate Terraform code tailored to your Ubuntu or Debian server. Customize DNS, NTP, APT sources, firewall, and SSH key management.

Choose the operating system version to target.
Enter DNS server IPs, separated by commas.
Enter NTP server URLs, separated by commas.
Customize APT sources list. You can use our Ubuntu APT Sources Generator or Debian APT Sources Generator to get ready quickly.
Enter the SSH public key for the root user.
Enable or disable the firewall for SSH.
Enter your LinuxPatch Registration token for agent configuration.

Live Preview

provider "local" {
  version = "~> 2.0"
}

resource "local_file" "setup" {
  content = <<-EOT
# OS Version: ubuntu-24.04

# NTP Servers
ntp_servers:
  - pool.ntp.org
  - ntp.ubuntu.com

# APT Sources List
apt_sources_list: |
deb http://archive.ubuntu.com/ubuntu noble main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu noble-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu noble-security main restricted universe multiverse

# Enable Firewall for SSH
firewall:
  - allow_ssh: true

EOT
  filename = "/tmp/setup.sh"
}

Manage your Linux servers effortlessly with LinuxPatch.com!