1
Fly.io terraform
Rich In SQL edited this page 2022-09-10 18:56:13 +01:00

Deploying Actual on fly.io with terraform

Requirements

  1. Install terraform.
  2. Ensure you've installed the flyctl utility and logged in.
  3. Copy the terraform subdirectory of actual-server (link).

Terminal 1: Setup

  1. Enter the terraform subdirectory of actual-server.
  2. Log in to fly.io by running
    fly auth login
    
  3. Set your fly.io API key as an evironment variable
    export FLY_API_TOKEN=$(fly auth token)
    

Terminal 2: Open Wireguard Tunnel

  1. In a separate terminal, run

    fly machines api-proxy
    

    image

    This will open a wireguard tunnel from your local machine to fly's infrastructure allowing terraform to access the machines api.

Deploy

  1. Return to terminal 1.

  2. Initialize terraform by running the following command in the terraform directory:

    terraform init
    
  3. Update the ex.tfvars file (or use your preferred method of variable provision), then:

    terraform apply -var-file=ex.tfvars
    
  4. Review the plan, and enter yes if it matches expectations.

    image

You should now have a running app! Open your fly.io dashboard to inspect any additional details.

Frequent Issues

If you're stuck or find a step unclear, the community in Discord may be able to assist you.