> 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/quickstart-guides/for-administrators/agent-setup.md).

# Agent setup

## Setting Up OCS Inventory Agent on Linux&#x20;

{% stepper %}
{% step %}

### Download and extract the agent

Navigate to the [OCS Inventory Agent](https://github.com/OCSInventory-NG/OCSInventory-Agent-Rework/releases) release page and download the agent package.

Extract the downloaded package:

```sh
tar -xzf OCSInventory-Agent-Rework-Linux.tar.gz
cd OCSInventory-Agent-Rework/setup/linux/
```

{% endstep %}

{% step %}

### Install the agent

Run the installation script in **non-interactive mode**: Replace `<server-ip>`, `<username>`, `<password>`, and `<certificate-path>` with your actual values:

{% code overflow="wrap" %}

```sh
sudo sh install.sh -l http://<server-ip>:<port> -u <username> -p <password> -m 2 -v 3 -s -n -c <certificate-path>
```

{% endcode %}

Example output:

{% code overflow="wrap" %}

```sh
❯ sudo sh install.sh -l http://127.0.0.1:8000 -u testuser -p testpassword -m 2 -v 3 -s -n -c myserver.pem

+----------------------------------------------------------+
|                                                          |
|  Welcome to OCS Inventory NG Agent in silent mode... !   |
|                                                          |
+----------------------------------------------------------+

Log level is set to 3
Inventory mode is set to 2
Running the agent now...
Creating ocsinventory-agent service file...
Reloading daemon and enabling service
Created symlink /etc/systemd/system/multi-user.target.wants/ocsinventory-agent.service → /etc/systemd/system/ocsinventory-agent.service.
Service Started

+------------------------------------------------------------------------------+
|   OK, OCS Inventory NG Agent for Unix/Linux has been successfully            |
|                    installed and configured.                                 |
|                                                                              |
|   Configuration files are located in /etc/ocsinventory-agent                 |
|   Log file is located in /var/log/ocsinventory-agent/ocsinventory-agent.log  |
|   Store Data Path is located in /var/lib/ocsinventory-data                   |
|   Agent Installation Directory is located in /usr/share/ocsinventory-agent   |
|                                                                              |
|                                                                              |
|   Enjoy OCS Inventory NG Agent ;-)                                           |
+------------------------------------------------------------------------------+
```

{% endcode %}

{% hint style="info" %}
Ensure the user account used for the agent has the following permissions for **Inventory - Assets** on the OCS Inventory server:

* **Add**
* **Update**
* **View**

For User and Groups configuration, refer to [Configuration basics](/administrator-docs/server-setup/configuration/basics.md).
{% endhint %}
{% endstep %}

{% step %}

### Verify the installation

Check the logs:

```sh
cat /var/log/ocsinventory-agent/ocsinventory-agent.log
```

Ensure the agent is running as a service:

```sh
sudo systemctl status ocsinventory-agent
```

{% endstep %}
{% endstepper %}

## Running the agent manually

To manually run the agent for troubleshooting or testing:

```sh
sudo /usr/bin/ocsinventory-agent-ng -v 3
```

For advanced setups and configuration, please check our [Agent Setup](/administrator-docs/agent-setup.md) section.


---

# 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/quickstart-guides/for-administrators/agent-setup.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.
