> ## Documentation Index
> Fetch the complete documentation index at: https://red5.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy Red5 Pro to AWS, GCP, or Azure with Terraform

> Deploy a scalable Red5 Pro cluster to AWS, GCP, Azure, DigitalOcean, or OCI using official Terraform modules — Stream Manager and node groups included.

Red5 Pro provides official Terraform modules for deploying fully configured clusters on major cloud platforms. Terraform automates the provisioning of all required infrastructure — virtual machines, networking, security groups, and load balancers — so you get a reproducible, version-controlled deployment without manual cloud console work.

A typical deployment provisions a **Stream Manager** plus a node group consisting of origin, edge, and relay nodes. The Stream Manager URL is printed as a Terraform output at the end of the apply step.

<Note>
  If you prefer a fully managed experience without operating your own infrastructure, consider [Red5 Cloud](https://www.red5.net/red5-cloud/), the hosted version of Red5 Pro.
</Note>

## Prerequisites

Before you begin, make sure you have:

* **Terraform** (version 1.x or later) installed on your workstation. Download from [developer.hashicorp.com/terraform](https://developer.hashicorp.com/terraform/downloads).
* **Cloud provider credentials** configured in your environment. For AWS this means an IAM user with programmatic access; for GCP a service account JSON key; for Azure a service principal.
* **A valid Red5 Pro license key** from [account.red5.net](https://account.red5.net/overview).
* **Sufficient cloud quota** for the instance types you plan to use.

***

## General Terraform workflow

Regardless of which cloud provider you target, the deployment process follows the same five steps:

<Steps>
  <Step title="Find the module on the Terraform Registry">
    All Red5 Pro modules are published at [registry.terraform.io/modules/red5pro/red5pro](https://registry.terraform.io/modules/red5pro/red5pro). Each cloud provider has its own module with dedicated documentation.
  </Step>

  <Step title="Create a Terraform configuration file">
    Create a `main.tf` (or clone the example from the registry) and reference the module, then create a `terraform.tfvars` file with your specific values:

    ```hcl theme={null}
    # terraform.tfvars example — replace all placeholder values
    red5pro_license_key = "YOUR_LICENSE_KEY"
    aws_region          = "us-east-1"
    ssh_key_name        = "my-key-pair"
    # ... additional variables per the module's documentation
    ```
  </Step>

  <Step title="Initialize the working directory">
    ```bash theme={null}
    terraform init
    ```

    This downloads the module and any provider plugins.
  </Step>

  <Step title="Preview the planned changes">
    ```bash theme={null}
    terraform plan
    ```

    Review the output to confirm the resources Terraform will create before you apply anything.
  </Step>

  <Step title="Apply and deploy">
    ```bash theme={null}
    terraform apply
    ```

    Type `yes` when prompted. Terraform provisions all resources and prints the Stream Manager URL when complete:

    ```text theme={null}
    Outputs:

    stream_manager_url = "https://sm.your-domain.com:443"
    ```
  </Step>
</Steps>

<Tip>
  Store your Terraform state in a remote backend such as S3, GCS, or Terraform Cloud so that multiple team members can manage the same deployment safely.
</Tip>

***

## Cloud provider modules

<Tabs>
  <Tab title="AWS">
    The AWS module deploys Red5 Pro into a VPC with an autoscaling node group managed by Stream Manager.

    **Module:** [registry.terraform.io — AWS](https://registry.terraform.io/modules/red5pro/red5pro/aws/latest)

    Minimum `terraform.tfvars` variables to configure:

    ```hcl theme={null}
    red5pro_license_key        = "YOUR_LICENSE_KEY"
    aws_region                 = "us-east-1"
    ssh_key_name               = "my-aws-keypair"
    stream_manager_instance_type = "t3.medium"
    node_origin_instance_type  = "t3.medium"
    node_edge_instance_type    = "t3.medium"
    ```

    <Info>
      Use the **Ubuntu 22.04** AMI for all instances. The Amazon Linux AMI is not supported and may be missing libraries required by Red5 Pro.
    </Info>
  </Tab>

  <Tab title="GCP">
    The GCP module provisions Compute Engine instances, firewall rules, and a load balancer in your chosen region.

    **Module:** [registry.terraform.io — GCP](https://registry.terraform.io/modules/red5pro/red5pro/gcp/latest)

    Minimum `terraform.tfvars` variables to configure:

    ```hcl theme={null}
    red5pro_license_key        = "YOUR_LICENSE_KEY"
    gcp_project_id             = "my-gcp-project"
    gcp_region                 = "us-central1"
    gcp_zone                   = "us-central1-a"
    stream_manager_machine_type = "n2-standard-2"
    node_origin_machine_type   = "n2-standard-2"
    node_edge_machine_type     = "n2-standard-2"
    ```
  </Tab>

  <Tab title="DigitalOcean">
    The DigitalOcean module creates Droplets, a VPC, and firewall rules in your chosen region.

    **Module:** [registry.terraform.io — DigitalOcean](https://registry.terraform.io/modules/red5pro/red5pro/digitalocean/latest)

    Minimum `terraform.tfvars` variables to configure:

    ```hcl theme={null}
    red5pro_license_key        = "YOUR_LICENSE_KEY"
    digitalocean_region        = "nyc3"
    stream_manager_droplet_size = "s-2vcpu-4gb"
    node_origin_droplet_size   = "s-2vcpu-4gb"
    node_edge_droplet_size     = "s-2vcpu-4gb"
    ```
  </Tab>

  <Tab title="OCI">
    The OCI module deploys Red5 Pro on Oracle Cloud Infrastructure using Compute instances and Virtual Cloud Networks.

    **Module:** [registry.terraform.io — OCI](https://registry.terraform.io/modules/red5pro/red5pro/oci/latest)

    Minimum `terraform.tfvars` variables to configure:

    ```hcl theme={null}
    red5pro_license_key        = "YOUR_LICENSE_KEY"
    oracle_region              = "us-ashburn-1"
    oracle_tenancy_ocid        = "ocid1.tenancy.oc1..xxx"
    oracle_user_ocid           = "ocid1.user.oc1..xxx"
    oracle_fingerprint         = "xx:xx:xx:xx"
    oracle_private_key_path    = "~/.oci/oci_api_key.pem"
    stream_manager_shape       = "VM.Standard.E4.Flex"
    ```
  </Tab>
</Tabs>

***

## What gets deployed

A complete Red5 Pro Terraform deployment provisions:

* **Stream Manager** — orchestrates autoscaling and routes streams between nodes. Accessible via HTTPS on port 443.
* **Origin nodes** — receive inbound streams from publishers.
* **Edge nodes** — distribute streams to viewers, scaling horizontally as concurrent connections increase.
* **Relay nodes** (optional) — bridge streams between geographic regions.
* **Security groups / firewall rules** — opens the [required ports](/red5-pro/installation/overview#prerequisites) for RTMP, WebRTC, and RTSP.

***

## Tear down the deployment

To remove all provisioned resources:

```bash theme={null}
terraform destroy
```

<Warning>
  `terraform destroy` permanently deletes all infrastructure created by the module, including any recorded stream data on the instances. Back up any data you need to keep before running this command.
</Warning>
