Terraform configuration to deploy OpenWebUI on Azure Container Apps with persistent storage.
ℹ️ This is a Terraform implementation of the guide: Deploy OpenWebUI on Azure Container Apps (which uses Azure Portal)
-
Scaling: Fixed to 1 replica (required for stability)
min_replicas = 1 max_replicas = 1
-
Storage: Azure File Share with required mount options
mount_options = "nobrl" # Required for proper file locking
- Azure CLI (install)
- Terraform >= 1.0.0
- Azure subscription
-
Clone and enter the repository:
git clone https://github.com/yourusername/azure-openwebui-infra.git cd azure-openwebui-infra -
Configure your Azure credentials:
az login
-
Initialize Terraform:
terraform init
-
Deploy:
terraform apply
- The application requires exactly 1 replica for stable operation
- Persistent storage uses Azure File Share with
nobrlmount option for compatibility - Default configuration includes HTTPS with Let's Encrypt
Customize your deployment by editing these variables in variables.tf or creating a terraform.tfvars file:
location = "northeurope" # Azure region
container_app_name = "openwebui" # Name for your container app
container_image = "ghcr.io/open-webui/open-webui:main" # Version to deployKey configuration options:
location: Azure region (default: "northeurope")resource_group_name: Name for the resource groupcontainer_app_name: Name for the Container Appcontainer_image: Docker image to usetarget_port: Port the application listens on (default: 8080)
To remove all resources:
terraform destroyMIT - Feel free to use and modify this configuration for your needs.