OpenTofu provider for Open WebUI 0.13. Fork of chrisguidry/terraform-provider-openwebui (itself from docktape), MPL-2.0.
  • Go 99%
  • Shell 0.5%
  • Python 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
John a40bd0a133
All checks were successful
CI / release-check-1 (push) Successful in 14s
CI / release-check (push) Successful in 0s
Release / release-1 (push) Successful in 20s
Release / release (push) Successful in 0s
CI / check (push) Successful in 5m7s
Merge pull request 'release: 0.1.0-dev.10 — tool server display name' (#12) from feat/tool-server-display-name into main
2026-11-27 23:33:02 +00:00
.forgejo feat: narrow model settings and tool server access; release 0.1.0-dev.4 2026-11-26 12:35:19 +00:00
docs release: 0.1.0-dev.10 — tool server display name 2026-11-27 23:30:28 +00:00
examples feat: video generation access (group features, model capability); release 0.1.0-dev.7 2026-11-27 05:32:47 +00:00
internal release: 0.1.0-dev.10 — tool server display name 2026-11-27 23:30:28 +00:00
plans Bring the provider to full Open WebUI v0.11 coverage 2026-08-14 09:37:07 -04:00
scripts Bring the provider to full Open WebUI v0.11 coverage 2026-08-14 09:37:07 -04:00
tools chore: add tfplugindocs as Go tool dependency 2026-06-01 09:40:01 +02:00
.gitattributes chore: enforce LF line endings via .gitattributes 2026-05-29 11:07:13 +02:00
.gitignore feat: narrow model settings and tool server access; release 0.1.0-dev.4 2026-11-26 12:35:19 +00:00
.gitleaksignore fix: clear security scan (deps, reviewed upstream example) 2026-11-26 05:48:10 +00:00
.golangci.yml ci: add golangci-lint, generate check, and fix all lint violations 2026-06-02 21:09:21 +02:00
CHANGELOG.md release: 0.1.0-dev.10 — tool server display name 2026-11-27 23:30:28 +00:00
doc.go chore: add tfplugindocs as Go tool dependency 2026-06-01 09:40:01 +02:00
go.mod fix: clear security scan (deps, reviewed upstream example) 2026-11-26 05:48:10 +00:00
go.sum fix: clear security scan (deps, reviewed upstream example) 2026-11-26 05:48:10 +00:00
LICENSE Add MPL-2.0 license 2026-06-03 16:23:48 +02:00
main.go feat: fork for Open WebUI 0.13 as registry.yawn.dev/john/openwebui 2026-11-26 05:40:48 +00:00
Makefile Bring the provider to full Open WebUI v0.11 coverage 2026-08-14 09:37:07 -04:00
README.md feat: fork for Open WebUI 0.13 as registry.yawn.dev/john/openwebui 2026-11-26 05:40:48 +00:00
release.json feat: fork for Open WebUI 0.13 as registry.yawn.dev/john/openwebui 2026-11-26 05:40:48 +00:00
terraform-registry-manifest.json chore: add terraform-registry-manifest.json for protocol v6 2026-06-02 21:31:25 +02:00
VERSION release: 0.1.0-dev.10 — tool server display name 2026-11-27 23:30:28 +00:00
yawn.json ci: wait for the required push checks before signing (yawn 0.3.1-dev.5) 2026-11-26 08:07:06 +00:00

OpenTofu Provider for Open WebUI

An OpenTofu provider that manages Open WebUI resources through its REST API: knowledge bases, models, skills, prompts, groups, users, channels, tools, tool servers, pipelines, functions, files, model connections, image and video generation, and the admin-level configuration surfaces.

  • Provider address: registry.yawn.dev/john/openwebui
  • Source: code.yawn.dev/john/tofu-provider-openwebui

This is a fork of chrisguidry/terraform-provider-openwebui (Open WebUI v0.11), itself a fork of docktape/terraform-provider-openwebui. It tracks Open WebUI v0.13.x: openwebui_images_config is rewritten for the v0.13 connection-based image settings and openwebui_videos_config is new. The originals are MPL-2.0 and so is this fork; full history is kept.

Releases are built reproducibly and their SHA256SUMS is GPG-signed by the release deployer, so a plain tofu init verifies them.

Compatibility

Component Requirement
OpenTofu 1.6 or newer
Open WebUI v0.13.x
Go 1.27+ (only required to build the provider)

This build targets one Open WebUI minor version, not a range. It reads meta.chat_variables_schema on models and the flat configuration export, and neither exists at v0.9.x.

Attributes backed by API endpoints that appeared in a later patch release are marked optional and noted in their schema descriptions.

The engine configuration resources need review at each release

openwebui_rag_config, openwebui_rag_embedding_config, openwebui_audio_config, openwebui_images_config and openwebui_videos_config track the retrieval.py, audio.py, images.py and videos.py routers. At v0.11.0 three of them changed by 1,742 added and 1,241 removed lines between v0.9.6 and v0.11.0, and images.py moved its whole configuration surface from application state to the per-key config table. Read the diff of these three routers at every Open WebUI release, and expect these four resources to need work.

Provider Configuration

terraform {
  required_providers {
    openwebui = {
      source  = "registry.yawn.dev/john/openwebui"
      version = "= 0.1.0"
    }
  }
}

provider "openwebui" {
  endpoint = "https://openwebui.example.com"
  token    = var.openwebui_token
}

variable "openwebui_token" {
  type        = string
  sensitive   = true
  description = "Admin API token for the Open WebUI instance."
}
Argument Env var Required Description
endpoint OPENWEBUI_ENDPOINT Yes Base URL of the instance, e.g. https://openwebui.example.com.
token OPENWEBUI_TOKEN Yes Bearer token used to authenticate API requests (sensitive).
insecure_skip_verify OPENWEBUI_INSECURE No Disable TLS certificate verification. Not recommended for production.

Resources

Resource Description
openwebui_knowledge Knowledge base entries
openwebui_knowledge_file File attachments on a knowledge base
openwebui_model Custom model definitions
openwebui_skill Reusable skills a model can call
openwebui_prompt Reusable prompt commands
openwebui_group User groups with permissions
openwebui_user User accounts
openwebui_channel Chat channels
openwebui_tool Python tools
openwebui_tool_valves Settings (valves) for a tool
openwebui_tool_server One external tool server, OpenAPI or MCP
openwebui_tool_servers_config The whole external tool server list
openwebui_terminal_server One terminal server the built-in terminal proxies to
openwebui_pipeline Pipeline registrations
openwebui_pipeline_valves Settings (valves) for a pipeline
openwebui_function Python functions
openwebui_function_valves Settings (valves) for a function
openwebui_file Uploaded files
openwebui_openai_connections OpenAI-compatible model connections
openwebui_ollama_connections Ollama model connections
openwebui_connections_config Direct connection settings
openwebui_code_execution_config Code execution and interpreter settings
openwebui_models_config Default model ordering and defaults
openwebui_suggestions_config Default prompt suggestions
openwebui_banners_config UI announcement banners
openwebui_admin_config Instance-wide administrative settings
openwebui_ldap_config LDAP authentication settings
openwebui_default_user_permissions Permissions every user starts with
openwebui_chat_config Chat context compaction and retention
openwebui_task_config Task model and its prompt templates
openwebui_evaluation_config Arena evaluation models
openwebui_subagents_config Subagent settings
openwebui_rag_config Retrieval settings
openwebui_rag_embedding_config Embedding engine settings
openwebui_images_config Image generation and editing: switches, defaults, connections
openwebui_videos_config Video generation: switch, default model, connections
openwebui_audio_config Speech to text and text to speech engines
openwebui_oauth_client OAuth client registrations
openwebui_config_import Bulk configuration restore

Data Sources

Data Source Description
openwebui_model Look up a model by name or ID
openwebui_knowledge Look up a knowledge base by name or ID
openwebui_skill Look up a skill by name or ID
openwebui_prompt Look up a prompt by command or ID
openwebui_group Look up a group by name or ID
openwebui_user Look up a user by email or ID
openwebui_channel Look up a channel by name or ID
openwebui_tool Look up a tool by name or ID
openwebui_tool_server Look up a tool server by its server ID
openwebui_pipeline Look up a pipeline by name or ID
openwebui_file Look up a single uploaded file
openwebui_files List uploaded files
openwebui_config_export Export the current Open WebUI configuration
openwebui_tool_server_verify Verify connectivity to an external tool server
openwebui_openai_connection_verify Verify an OpenAI-compatible connection
openwebui_ollama_connection_verify Verify an Ollama connection

Full per-resource and per-data-source documentation is in docs/, with runnable configurations under examples/.

API Coverage

Open WebUI v0.11.0 has 31 routers. The table names each one, what the provider does with it, and why, so "covers the API" is a claim you can check.

Four reasons carry the exclusions:

  • (a) No read route an admin token can reach, so state can never converge.
  • (b) Runtime data rather than configuration.
  • (c) The read masks or encrypts what the write sent.
  • (d) Overlaps a surface the provider already manages.
Router Coverage
analytics.py Excluded (b). Every route computes counts on the fly and stores nothing.
audio.py openwebui_audio_config.
auths.py openwebui_admin_config and openwebui_ldap_config. The OAuth settings are excluded, see below.
automations.py Excluded (a), (b). The access check has no admin branch, so an admin token reading another user's automation gets a 404.
calendar.py Excluded (b). Per-user calendars, created on a user permission with no admin branch.
channels.py openwebui_channel and its data source. Messages and read receipts are excluded (b).
chats.py openwebui_chat_config. Transcripts and their per-user lifecycle are excluded (b).
configs.py openwebui_connections_config, openwebui_tool_server, openwebui_tool_servers_config, openwebui_terminal_server, openwebui_code_execution_config, openwebui_models_config, openwebui_suggestions_config, openwebui_banners_config, openwebui_subagents_config, openwebui_oauth_client, openwebui_config_import, openwebui_config_export.
evaluations.py openwebui_evaluation_config. Feedback and leaderboards are excluded (b).
files.py openwebui_file, openwebui_file and openwebui_files data sources.
folders.py Excluded (b). Folders are per-owner, and deleting one deletes the owner's chats inside it.
functions.py openwebui_function and openwebui_function_valves.
groups.py openwebui_group and its data source.
images.py openwebui_images_config. Generating and editing images is excluded (b).
videos.py openwebui_videos_config. Generating videos is excluded (b).
knowledge.py openwebui_knowledge and openwebui_knowledge_file. External knowledge connections are not built yet; they matter only to an instance that keeps its vectors in Qdrant, Milvus, or pgvector.
memories.py Excluded (a), (b). Every read is scoped to the calling user, and the content is learned from conversations.
models.py openwebui_model and its data source.
notes.py Excluded (b). A per-user rich-text document, created on a user permission with no admin branch.
notifications.py Excluded (b), (c). Targets live in user settings, and the read replaces the webhook URL with a masked one.
ollama.py openwebui_ollama_connections and openwebui_ollama_connection_verify.
openai.py openwebui_openai_connections and openwebui_openai_connection_verify.
pipelines.py openwebui_pipeline, openwebui_pipeline_valves, and the pipeline data source.
prompts.py openwebui_prompt and its data source.
retrieval.py openwebui_rag_config and openwebui_rag_embedding_config. Ingesting, querying, and resetting are excluded (b).
scim.py Excluded (a), (d). A SCIM facade over the same user and group tables, off by default, and its own settings are environment reads no API can write.
skills.py openwebui_skill and its data source.
tasks.py openwebui_task_config.
terminals.py Excluded (d). A reverse proxy. The declarable object is the connection list, which openwebui_terminal_server manages through configs.py.
tools.py openwebui_tool, openwebui_tool_valves, openwebui_tool_server, and the tool server data sources.
users.py openwebui_user, its data source, and openwebui_default_user_permissions.
utils.py Excluded (b), (d). Five one-shot actions. The only settings it reads belong to openwebui_code_execution_config.

Decided exclusions

  • OAuth settings (auths.py), excluded by decision. Open WebUI does not persist a key beginning with oauth. unless the instance sets ENABLE_OAUTH_PERSISTENT_CONFIG, which is off by default. With it off the apply succeeds, the read-back matches, and the value is gone at the next restart. Deployments normally set OAuth through the environment. Reach these keys with openwebui_config_import if you need them.
  • External knowledge connections (knowledge.py), not built. Full CRUD over one config key, useful only with an external vector store.
  • Channel webhooks (channels.py), not built. State could converge, since the read returns the token in cleartext, but there is no read by webhook id. Import would need a channel_id/webhook_id key resolved against the per-channel list. It is a follow-on to openwebui_channel, not part of covering the channel itself.

Usage Examples

Knowledge base

resource "openwebui_knowledge" "example" {
  name        = "Support FAQ"
  description = "Knowledge base backing the support chatbot"

  read_groups  = ["Support"]
  write_groups = ["Support"]
}

Model

resource "openwebui_model" "example" {
  model_id      = "custom-rag"
  name          = "Custom RAG Model"
  base_model_id = "llama3.2"
  is_active     = true
  hidden        = false
  description   = "RAG-tuned model for the internal knowledge base"

  read_groups  = ["Support"]
  write_groups = ["Support"]

  # A grant can also name one account, by mail address or user ID.
  read_users = ["contractor@example.com"]

  params {
    temperature = 0.1
    num_ctx     = 4096
  }

  capabilities {
    vision     = false
    web_search = true
  }
}

Group

resource "openwebui_group" "example" {
  name        = "Support"
  description = "Support team access group"

  users = [
    "alice@example.com",
    "bob@example.com",
  ]

  permissions = {
    workspace = {
      models    = true
      knowledge = true
      prompts   = true
      tools     = false
    }
    chat = {
      file_upload = true
      delete      = true
      edit        = true
    }
    features = {
      web_search = true
    }
    access_grants = {
      allow_users = true
    }
    settings = {
      interface = true
    }
  }
}

Prompt

resource "openwebui_prompt" "example" {
  command   = "summarize"
  name      = "Summarise text"
  content   = "Summarise the following in three bullet points:\n\n{{text}}"
  is_active = true
  tags      = ["productivity", "writing"]
}

License

This provider is distributed under the terms of the Mozilla Public License 2.0 (MPL-2.0).