Linux installation
OCS Inventory provides official package repositories for common Linux distributions. This is the recommended installation method when available: it installs prebuilt binaries (no Dart SDK required) and lets you upgrade/uninstall using the system package manager.
Supported platforms
Linux distributions using APT (Debian based) or RPM (RHEL based)
Architecture:
amd64/x86_64only
Installation
Add the OCS Inventory repository
Add the OCS Inventory repository. This imports the GPG key used to sign OCS Inventory packages and registers the APT repository.
Replace <distribution_codename> with your system’s codename.
Supported codenames:
Debian:
bookworm,trixieUbuntu:
jammy,noble,plucky
curl -fsSL https://deb-v3.ocsinventory-ng.org/repo-signing-key.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/ocs-archive-keyring.gpg
echo "deb https://deb-v3.ocsinventory-ng.org/ <distribution_codename> main" | sudo tee /etc/apt/sources.list.d/ocsinventory.list
sudo apt updateThis installs:
/etc/apt/trusted.gpg.d/ocs-archive-keyring.gpg- the public GPG key used to verify package signatures/etc/apt/sources.list.d/ocsinventory.list- the repository definition
Add the OCS Inventory repository
The ocsinventory-release package configures the YUM/DNF repository and imports the GPG key used to sign OCS Inventory packages.
sudo dnf install -y https://rpm-v3.ocsinventory-ng.org/rpm/ocsinventory-release-latest.[elX|fcXX].noarch.rpmReplace
elXorfcXXwith the version matching your operating system, from those supported by OCS Inventory:
Enterprise Linux (RHEL, Rocky, AlmaLinux):
el9,el10Fedora:
fc42,fc43,fc44
This installs:
/etc/yum.repos.d/ocsinventory.repo- the repository definition/etc/pki/rpm-gpg/RPM-GPG-KEY-ocsinventory- the public GPG key, imported automatically on install
The key is not imported at this point. DNF imports it automatically the first time a package is actually installed from the ocsinventory repository (see step 2), prompting you to confirm the key fingerprint unless assumeyes is set.
Install the packages
sudo dnf install -y ocsinventory-agentOn this first install from the ocsinventory repository, DNF prompts you to confirm and import the GPG key. Once accepted, you can verify it was imported with:
rpm -qa gpg-pubkey* --qf '%{name}-%{version}-%{release} --> %{summary}\n' | grep -i ocsinventorySilent installation
The agent can be installed and configured without any prompt, for mass deployment.
DEBIAN_FRONTEND=noninteractive is what makes the installation silent: on a fresh install, the package runs the interactive setup wizard whenever it detects a terminal. Without the wizard, the package configures the agent in local mode (mode: 4) with an empty server URL, so a second command is needed to point it at your server:
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y ocsinventory-agent
sudo ocsinventory-cli --overwrite_config true \
--url http://server_ip:port \
--username username \
--password password \
--mode 1 \
--log_level 3The second command writes those values to /etc/ocsinventory-agent/config.json and runs a first inventory, so a zero exit code means the agent is configured and reached the server. Only the options you pass are written, so pass at least --url, --username, --password and --mode.
The package installs the systemd unit but leaves it stopped. Enable it to get periodic inventories:
Post-Install Configuration
There are three ways to configure the agent after installation:
Run the interactive setup, which walks you through the configuration step by step:
Edit the configuration file directly:
Persist settings via the CLI, using
--overwrite_config true:
Verification
Package name:
ocsinventory-agentCommand to run the agent:
ocsinventory-cliFiles:
/usr/local/bin/ocsinventory-cli(installed binary)/usr/bin/ocsinventory-cli(symlink)/etc/ocsinventory-agent/config.json(main config)/usr/share/ocsinventory-agent/(install/uninstall helper scripts + service file)
Run the agent with:
Local modes (
3/4): check for a new inventory file in yourdata_directory.Remote modes (
1/2): confirm the asset appears/updates on the server.
Last updated

