---
title: "MacOS"
description: "Install Middleware macOS Agent to capture system and application data for monitoring and performance insights."
section: "Agent Installation"
breadcrumb: "Mac OS"
canonical: "https://docs.middleware.io/get-started/agent/macos"
---
# MacOS

The Middleware Infrastructure Agent collects macOS host telemetry to help you monitor resource usage and investigate host performance. Configured logs and application traces add context about the workloads running on the host.

Use this integration to monitor macOS hosts and send their infrastructure and application telemetry to Middleware.

## Prerequisites

Before installing the Middleware Infrastructure Agent on macOS, make sure your system meets the following requirements:

- **macOS Version**: v10.15 (Catalina) or later
- **Hardware**: Apple Silicon (M1/M2/M3/M4) or Intel (x86_64)
- **Permissions**: You’ll need admin (`sudo`) access to install

## Install

There are two ways you can install the Middleware agent on macOS. You can either use the one-liner command execution or go with the GUI installer.

#### Bash

Copy & paste by replacing the placeholders:

```bash
MW_API_KEY="your-initial-token" MW_TARGET="your-initial-uid" \
bash -c "$(curl -L https://install.middleware.io/scripts/mw-macos-agent-install.sh)"
```

The above command will trigger the following:

- Auto-detects your CPU (Apple Silicon vs Intel) and installs into `/opt/mw-agent`.
- Config files land in `/etc/mw-agent`; logs in `/var/log/mw-agent`.

#### GUI

1. **Download the PKG** for your architecture from GitHub:

   - Apple Silicon: [Middleware agent for Apple Silicon](https://github.com/middleware-labs/mw-agent/releases/latest/download/mw-macos-agent-setup-arm64.pkg)
   - Intel: [Middleware package for Apple Intel machine](https://github.com/middleware-labs/mw-agent/releases/latest/download/mw-macos-agent-setup-amd64.pkg)
2. Double-click the `.pkg` and follow the wizard.
3. Enter your `MW_API_KEY` and `MW_TARGET` when prompted.

   ![macOS GUI Installer](/images/agent/macos.png)

## Agent Directory Layout

| Path | Contents |
| --- | --- |
| `/opt/mw-agent` | Agent binary & libraries |
| `/etc/mw-agent` | `mw-agent.yaml` & conf.d/ |
| `/var/log/mw-agent` | Agent log files |

**Why this matters**: A clear, sandboxed layout makes upgrades, backups, and troubleshooting straightforward.

## Verify Installation

Once you are done with the previous steps, the installation can be verified using the following:

```bash
sudo launchctl list | grep mw-agent
```

A healthy agent returns something like:

```bash
33105    0    io.middleware.mw-agent
```

## Verify data collection

After installing the Agent, allow a few moments for the host to start reporting telemetry.

Go to [Infrastructure Monitoring → Hosts](https://app.middleware.io/infrastructure/host) and verify that your macOS host appears and is reporting metrics.

After data collection starts, you can:

- View host metrics in [Infrastructure Monitoring](https://app.middleware.io/infrastructure/).
- View collected host logs in [Log Monitoring](https://app.middleware.io/logs).
- Create [alerts](/features/alerts) for collected metrics.
- Create [custom dashboards](/features/dashboards) to visualize and monitor macOS host metrics.

## Troubleshooting

### Common issues and how to resolve them:

1. **Multiple Agents Running**

   - Only one MW Agent should be installed per macOS host.

     ```bash
         sudo launchctl list | grep mw-agent
     ```
   - If you see more than one entry, remove duplicates:

     ```bash
         sudo /opt/mw-agent/uninstall.sh
     ```
2. **No Data Appearing in Middleware.io**

   - Network access: Verify the host can reach your `MW_TARGET` URL on port 443.
   - API key validity: Double-check that `MW_API_KEY` is correct.
   - Proxy/firewall: Ensure no proxy or firewall is blocking outbound traffic.
3. **Installation Script Errors**

   - Permission issues: Rerun the install command with `sudo`.
   - Inspect logs:

     ```bash
         ls /var/log/mw-agent/
     tail -n 50 /var/log/mw-agent/install.log
     ```

If errors persist, contact support with the log excerpt.

## Uninstall

- Run the uninstall script:

  ```bash
      sudo /opt/mw-agent/uninstall.sh
  ```
- Confirm cleanup:

  ```bash
  ls /opt/mw-agent         # should report "No such file or directory"
  ls /etc/mw-agent         # no directory
  ls /var/log/mw-agent     # no directory
  ```

Need assistance or want to learn more about Middleware? Get in touch with us via our Contact Us page or join our Slack channel.
