> For the complete documentation index, see [llms.txt](https://documentation.ocsinventory-ng.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.ocsinventory-ng.org/administrator-docs/agent-setup/installation-methods/macos-installation.md).

# MacOS installation

### Installation

Download the archive from the release page's asset available here : <https://github.com/OCSInventory-NG/OCSInventory-Agent-Rework/releases>

You can also download from a terminal using curl (replace `<VERSION>` with the target version):

```bash
export VERSION="3.0.0-rc1" # Example for 3.0.0-rc1

curl -fsSL -o "OCSInventory-Agent-Setup-${VERSION}.tar.xz" \
"https://github.com/OCSInventory-NG/OCSInventory-Agent-Rework/releases/download/${VERSION}/OCSInventory-Agent-Setup-Macos-${VERSION}.tar.xz"
```

Then, extract the archive :&#x20;

```bash
tar -xJf OCSInventory-Agent-Setup-Macos-<version>.tar.xz
```

The archive contains:

* `install.sh`: installer script
* `uninstall.sh`: uninstaller script
* `com.ocsinventory.agent.plist`: LaunchDaemon definition (must stay next to `install.sh`)
* `ocsinventory-cli`: agent binary
* `README`

Run the installer as root, registering the LaunchDaemon and triggering an immediate run:

```bash
sudo ./install.sh \
  --url http://server_ip:port \
  --username username \
  --password password \
  --service \
  --now
```

{% hint style="info" %}
See [#silent-installation](#silent-installation "mention")below for silent deployment.
{% endhint %}

Available options:

| Option                       | Description                                                |
| ---------------------------- | ---------------------------------------------------------- |
| `-S`, `--silent`             | Silent mode (requires `--url`, `--username`, `--password`) |
| `-U`, `--url URL`            | OCS server URL                                             |
| `-u`, `--username USERNAME`  | Username                                                   |
| `-p`, `--password PASSWORD`  | Password                                                   |
| `-m`, `--mode MODE`          | Inventory mode (default: 1)                                |
| `-d`, `--data-path PATH`     | Data directory (default: `/var/lib/ocsinventory-data`)     |
| `-l`, `--log-level LEVEL`    | Log level 0–4 (default: 3)                                 |
| `--log-file`                 | Enable log file (default: true)                            |
| `--log-file-path PATH`       | Log file path (default: `/var/log/ocsinventory-agent.log`) |
| `-c`, `--certificate FILE`   | PEM certificate path (default: none)                       |
| `-b`, `--bypass-certificate` | Bypass certificate validation (default: false)             |
| `-s`, `--service`            | Register the LaunchDaemon                                  |
| `-n`, `--now`                | Run the agent once immediately after install               |
| `-h`, `--help`               | Show help and exit                                         |

### Silent installation

The agent can be installed and configured without any prompt, for mass deployment. Run `install.sh` with `--silent` from a directory that also contains the `ocsinventory-cli` binary, `com.ocsinventory.agent.plist` and `uninstall.sh`:

```bash
sudo ./install.sh --silent \
  --url https://server_ip:port \
  --username username \
  --password password \
  --mode 1 \
  --log-level 3 \
  --certificate /path/to/cert.pem \
  --service \
  --now
```

The binary is installed to `/usr/local/bin/ocsinventory-cli` and the configuration to `/etc/ocsinventory-agent/config.json`.

{% hint style="warning" %}
Two things to keep in mind: silent mode prints nothing on stdout, the full log is written to `install.log` next to the script; and a silent run on a host where the agent already exists uninstalls it first, configuration, logs and data included.
{% endhint %}

### Post-install configuration

Re-run the installer in silent mode to change settings without reinstalling from scratch:

```bash
sudo ./install.sh --silent --url http://server_ip:port --username username --password password
```

### Verification

Files:

* `ocsinventory-cli` (agent binary, location set at install time)
* `/Library/LaunchDaemons/com.ocsinventory.agent.plist` (LaunchDaemon definition)
* `/var/lib/ocsinventory-data/` (data directory, default)
* `/var/log/ocsinventory-agent.log` (log file, default)

Check the LaunchDaemon is loaded:

```bash
sudo launchctl list | grep ocsinventory
```

Run the agent manually:

```bash
sudo ocsinventory-cli
```

* Local modes (`3`/`4`): check for a new inventory file in the data directory.
* Remote modes (`1`/`2`): confirm the asset appears/updates on the server.

### Uninstall

```bash
sudo ./uninstall.sh
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://documentation.ocsinventory-ng.org/administrator-docs/agent-setup/installation-methods/macos-installation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
