---
title: "Configure Alertmanagers using mimirtool | Grafana Cloud documentation"
description: "Add an external Alertmanager using mimirtool"
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Configure Alertmanagers using `mimirtool`

In addition to [configuring Alertmanagers from the Grafana UI](/docs/grafana-cloud/alerting-and-irm/alerting/set-up/configure-alertmanager/), you can use `mimirtool` to set up an Alertmanager configuration for the Mimir instance running in your Grafana Cloud Stack.

## Install and configure access for `mimirtool`

`mimirtool` is a command-line tool for interacting with Grafana Mimir, which powers Grafana Cloud Metrics and Alerts. For detailed installation instructions and configuration options, refer to [`Mimirtool`](/docs/mimir/next/manage/tools/mimirtool/).

To use `mimirtool` with Grafana Cloud, you need the Mimir address of your Cloud Stack, a Cloud instance ID, and an API token with proper permissions.

Expand table

| Environment variable | Flag        | Description                                                                                                                                                  |
|----------------------|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `MIMIR_ADDRESS`      | `--address` | The address of the API of the Grafana Mimir cluster. For instance, [https://prometheus-us-central1.grafana.net](https://prometheus-us-central1.grafana.net). |
| `MIMIR_API_USER`     | `--user`    | Grafana Cloud instance ID. These should be part of `/orgs/<yourOrgName>`/.                                                                                   |
| `MIMIR_API_KEY`      | `--key`     | API token with permissions. Refer to [Grafana Cloud Access Policies](/docs/grafana-cloud/account-management/authentication-and-permissions/access-policies/) |

## Manage the Alertmanager configuration for a Grafana Cloud Mimir instance

With your instance ID, URL, and API token you’re now ready to upload your Alertmanager configuration. You can set the configuration options detailed in this guide, either as environment variables or command-line flags. Use the following commands and files as a reference.

Ultimately, you need to [write your own](https://prometheus.io/docs/alerting/latest/configuration/) or adapt an [configuration file example](https://github.com/prometheus/alertmanager/blob/master/doc/examples/simple.yml) for alerts to be delivered.

The following `alertmanager.yml` file is an example Alertmanager configuration. Note that this not a working configuration—alerts are not delivered using this setup, but the Alertmanager UI is accessible.

YAML ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```yaml
global:
  smtp_smarthost: 'localhost:25'
  smtp_from: 'youraddress@example.org'
route:
  receiver: example-email
receivers:
  - name: example-email
    email_configs:
      - to: 'youraddress@example.org'
```

With this file, you can run the following commands to upload your Alertmanager configuration in your Alerts instance.

Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```bash
mimirtool alertmanager load alertmanager.yml \
--address=https://alertmanager-us-central1.grafana.net \
--id=<yourID> \
--key=<yourKey>
```

Then, confirm that the rules were uploaded correctly by running:

Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```bash
mimirtool alertmanager get \
--address=https://alertmanager-us-central1.grafana.net \
--id=<yourID> \
--key=<yourKey>
```

You should see output similar to the following:

Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```bash
global:
  smtp_smarthost: 'localhost:25'
  smtp_from: 'youraddress@example.org'
route:
  receiver: example-email
receivers:
 - name: example-email
   email_configs:
    - to: 'youraddress@example.org'
```

Finally, you can delete the configuration with:

Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```bash
mimirtool alertmanager delete \
--address=https://alertmanager-us-central1.grafana.net \
--id=<yourID> \
--key=<yourKey>
```

## See also

- [Configure Alertmanagers](/docs/grafana-cloud/alerting-and-irm/alerting/set-up/configure-alertmanager/)
- [`Mimirtool`](/docs/mimir/next/manage/tools/mimirtool/)
- [Use `mimirtool` to upload alert and recording rules](/docs/grafana-cloud/alerting-and-irm/alerting/set-up/provision-alerting-resources/use-mimirtool/)
