Terraform
Provision a VM (AWS EC2 or Vultr) that runs HarborFM via user-data (PM2, nginx, optional WebRTC and Let's Encrypt).
Prerequisites
- Terraform installed (see QUICKSTART for macOS, Debian, and CentOS)
- AWS:
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY(oraws configure) - Vultr:
VULTR_API_KEYin.env(copy frominfrastructure/terraform/.env.example)
AWS (EC2)
cd infrastructure/terraform/awscp terraform.tfvars.example terraform.tfvars- Edit
terraform.tfvars:deploy_type,ami_id(Debian 12 for your region),domain,admin_email,admin_password, etc. ./run.sh initthen./run.sh apply- Use the url output to open the app. If you set
admin_emailandadmin_password, the admin is created on first boot.
AMI lookup (Debian 12): Owner 136693071363. Example for us-east-2:
aws ec2 describe-images --region us-east-2 --owners 136693071363 \
--filters "Name=name,Values=debian-12-*" "Name=state,Values=available" \
--query "sort_by(Images, &CreationDate)[-1].ImageId" --output text
Vultr
cd infrastructure/terraform/vultrcp terraform.tfvars.example terraform.tfvars- Edit
terraform.tfvars:deploy_type,region,os_id,plan,domain, etc. ./run.sh initthen./run.sh apply
OS IDs: list with Vultr's OS API. Common examples include Debian 12 2136 and Ubuntu 22 1743.
Full Reference
- infrastructure/terraform/README.md - variables, optional persistent data volume, multi-environment
- infrastructure/terraform/QUICKSTART.md - step-by-step install and first apply
See Also
- Docker Compose for install.sh-based hosts
- Environment Variables
- Usage: Deployment