---
title: "Configure | wasmCloud"
description: "Pass runtime configuration to wasmCloud capability providers using wash config or wadm manifests."
canonical: "https://wasmcloud.com/docs/v1/developer/providers/configure/"
---

This is documentation for wasmCloud **v1**, which is no longer actively maintained.

For up-to-date documentation, see the **[latest version](https://wasmcloud.com/docs/)** (v2).

Version: v1

# Configure

> **Planned changes to providers**
>
> The [**wasmCloud Q3 2025 Roadmap**](https://github.com/orgs/wasmCloud/projects/7) sets out plans for an overhaul to capability providers in the next major release of wasmCloud. This overhaul transitions providers to a "wRPC server" model in which WIT interfaces are served via one of the transports available with wRPC (e.g., TCP, NATS, QUIC, or UDP), enabling capability implementations to be written in any language and to be deployed independently in containers.
>
> For more information, see the [Roadmap](https://github.com/orgs/wasmCloud/projects/7), [Issue #4642: “Transition the capability provider model into support for wRPC servers,”](https://github.com/wasmCloud/wasmCloud/issues/4642) and [Issue #4636: "Support configuring a wasmCloud host with shared capability providers."](https://github.com/wasmCloud/wasmCloud/issues/4636)

Capability providers can be passed a map of configuration at runtime to use when executing. This configuration should first be defined using [wash](https://wasmcloud.com/docs/v1/ecosystem/wash/) or as a part of your [wadm](https://wasmcloud.com/docs/v1/ecosystem/wadm/) manifest, and then given to the capability provider at runtime.

## Define Configuration

**wadm**

If you're using [wadm](https://wasmcloud.com/docs/v1/ecosystem/wadm/) to declaratively define applications, you can use the `config` field to define configuration for your provider. Wadm will automatically manage creating the configuration for you and supplying it to the provider at runtime.

yaml

```yaml
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
  name: hello-world
  annotations:
    version: v0.0.1
    description: 'Capability provider that uses wasi:http and runtime configuration'
spec:
  components:
    - name: http-server
      type: capability
      properties:
        image: file://./build/http-server.par.gz
        config:
          - name: custom-config
            properties:
              foo: bar
              log-level: debug
      traits:
        # Govern the spread/scheduling of the component
        - type: spreadscaler
          properties:
            instances: 1
```

**wash**

If you're using [wash](https://wasmcloud.com/docs/v1/ecosystem/wash/) to imperatively start your component, you can first define configuration using the `wash config` subcommand, and then supply it alongside your component.

bash

```bash
# wash config put <config-name> <values...>
wash config put custom-config foo=bar log-level=debug
```

Then, when starting your capability provider with `wash`, you can supply the configuration using the `--config` flag:

bash

```bash
# wash start provider <component_ref> <component_id> --config <config-name>
wash start provider ghcr.io/wasmcloud/components/http-server:0.1.0 http-server --config custom-config
```

## Using Configuration

Capability providers are given configuration at startup and as a part of each link. You can use the

**Rust**

The [HostData](https://docs.rs/wasmcloud-provider-sdk/0.8.0/wasmcloud_provider_sdk/struct.HostData.html) contains configuration for the provider at startup:

rust

```rust
pub async fn run() -> anyhow::Result<()> {
    initialize_observability!(
        "my-provider",
        std::env::var_os("FLAMEGRAPH_PATH")
    );

    let host_data = load_host_data().context("failed to load host data")?;
    let config = host_data.config;
    let my_provider = MyProvider::new(config)
        .context("failed to create provider from hostdata configuration")?;
    let shutdown = run_provider(my_provider, "my-provider")
        .await
        .context("failed to run provider")?;
    shutdown.await;
    Ok(())
}
```

The functions on the [Provider](https://docs.rs/wasmcloud-provider-sdk/0.8.0/wasmcloud_provider_sdk/trait.Provider.html) trait in the SDK allow for handling links and fetching the configuration when it's established:

rust

```rust
impl Provider for MyProvider {
  async fn receive_link_config_as_source(
    &self,
    link: LinkConfig<'_>,
  ) -> anyhow::Result<()> {
    let config = link.config;
    Ok(())
  }

  async fn receive_link_config_as_target(
    &self,
    link: LinkConfig<'_>,
  ) -> anyhow::Result<()> {
    let config = link.config;
    Ok(())
  }
}
```

**Go**

The [HostData](https://github.com/wasmCloud/provider-sdk-go/blob/main/host.go#L21) struct contains the configuration passed to the provider at startup, and the [InterfaceLinkDefinition](https://github.com/wasmCloud/provider-sdk-go/blob/main/link.go#L20) struct contains the configuration passed to the provider when a link is established.

go

```go
package main

import (
	"github.com/wasmCloud/provider-sdk-go"
)

func main() {
  p := &Provider{}

	wasmcloudProvider, err := provider.New(
		provider.SourceLinkPut(p.handleNewSourceLink),
		provider.TargetLinkPut(p.handleNewTargetLink),
	)

  config := wasmcloudProvider.HostData().Config
}

func (p *Provider) handleNewSourceLink(link provider.InterfaceLinkDefinition) error {
  config := link.SourceConfig
	return nil
}

func (p *Provider) handleNewTargetLink(link provider.InterfaceLinkDefinition) error {
  config := link.TargetConfig
	return nil
}
```

## Supplying multiple configurations

In both the above `wadm` and `wash` methods of defining configuration, you can actually supply multiple named configurations to components, providers, and links. This is useful both to reuse common pieces of configuration and provide overrides for specific instances.

Let's a case where we have a set of reasonable defaults for connections to a database that we want multiple components to use, but we also want to be able to override the connection string for specific instances. This can be accomplished by defining the default configuration and then overriding it for specific instances.

We'll use the [wasmCloud HTTP Server settings](https://github.com/wasmCloud/wasmCloud/blob/main/crates/provider-http-server/settings.md) as an example. We'll [link](https://wasmcloud.com/docs/v1/concepts/linking-components/) the HTTP server to a component, supplying a default configuration with reasonable values and an additional configuration to change the address for that specific component. To create the default configuration, we can use the `wash config put` command:

bash

```bash
wash config put default-http max_content_len=5M readonly_mode=true address=0.0.0.0:80
```

By default, we'll limit the max content length to 5MB and ensure that components are only accepting **GET** and **HEAD** requests using the `readonly_mode` configuration. We'll also supply a default listen address of `0.0.0.0:80`.

For our component, we can use the default configuration by supplying the `default-http` configuration name, and then override the `address` configuration for this specific instance:

**wadm**

yaml

```yaml
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
  name: hello-world
  annotations:
    version: v0.0.1
    description: 'Component that uses wasi:http'
spec:
  components:
    - name: http-component
      type: component
      properties:
        image: file://./build/http_hello_world_s.wasm
      traits:
        # Govern the spread/scheduling of the component
        - type: spreadscaler
          properties:
            instances: 1
    # Add a capability provider that enables HTTP access
    - name: httpserver
      type: capability
      properties:
        image: ghcr.io/wasmcloud/http-server:0.26.0
      traits:
        - type: link
          properties:
          target: http-component
          namespace: wasi
          package: http
          interfaces: [incoming-handler]
          source_config:
            - name: default-http
            - name: custom-config
              properties:
                address: 0.0.0.0:4000
```

**wash**

bash

```bash
wash config put custom-config address=0.0.0.0:4000
```

Then, when linking the HTTP server with your component with `wash`, you can supply the configuration using the `--source-config` flag:

bash

```bash
# wash link put <source_id> <target> <namespace> <package> ...
wash link put http-server http-component wasi http --interface incoming-handler --source-config default-http --source-config custom-config
```

Configuration is merged together in a left-folding manner, meaning that the last configuration supplied will override any previous configurations. In the above example, the `address` configuration will be overridden to `0.0.0.0:4000`, but the `max_content_len` and `readonly_mode` configurations will remain the same as the default configuration. Put another way, the configuration this provider will receive with the link is:

json

```json
{
  "max_content_len": "5M",
  "readonly_mode": true,
  "address": "0.0.0:4000"
}
```

Last updated on **Jun 10, 2026** by **Liam Randall**
