Skip to content
Docker stack for OCSInventory Server
Branch: master
Clone or download
This branch is 3 commits ahead, 3 commits behind OCSInventory-NG:master.

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.


OCS Inventory

Some Links:
Ask question | Website | OCS Professional

OCS (Open Computers and Software Inventory Next Generation) is an assets management and deployment solution. Since 2001, OCS Inventory NG has been looking for making software and hardware more powerful. OCS Inventory NG asks its agents to know the software and hardware composition of every computer or server.

Assets management

Since 2001, OCS Inventory NG has been looking for making software and hardware more powerful. OCS Inventory NG asks its agents to know the software and hardware composition of every computer or server. OCS Inventory also ask to discover network’s elements which can’t receive an agent. Since the version 2.0, OCS Inventory NG take in charge the SNMP scans functionality. This functionality’s main goal is to complete the data retrieved from the IP Discover scan. These SNMP scans will allow you to add a lot more informations from your network devices : printers, scanner, routers, computer without agents, …


OCS Inventory NG includes the packet deployment functionality to be sure that all of the softwares environments which are on the network are the same. From the central management server, you can send the packets which will be downloaded with HTTP/HTTPS and launched by the agent on client’s computer. The OCS deployment is configured to make the packets less impactable on the network. OCS is used as a deployment tool on IT stock of more 100 000 devices.

###Docker Stack OCSInventory

This repository contains the needed files to build and run the OCS stack in his last version. This stack is based on the official Debian image and official MYSQL image, you can find them on the Docker hub. We include a MYSQL container with pre-configured with the required database settings.

###Build instructions

We use docker-compose to build these images. Clone this repo and then:

sudo git clone
cd OCSInventory-Docker-Stack
sudo docker-compose build

This command will build all the images and pull the latest version.

You can also find a prebuilt image for OCSInventory without MYSQL server from our Docker Hub repository or our Github, which can be pulled with this command:

sudo docker pull ocsinventory/ocsinventory-docker-image:master

###How to run it

By default, when the OCSInventory container is running it will load a default OCSInventory installation that is ready to be used. However, you can run the installer by defining one of these env variables, you can find them in the docker-compose.YML

####MYSQL container :



####OCSInventory-server container :

environment :

OCS_DBNAME : ocsweb
OCS_DBSERVER_READ : ocsinventory-db
OCS_DBSERVER_WRITE : ocsinventory-db

These values are the default values for OCSInventory. After adjusting the docker-compose.yml, you can test the containers with docker-compose

cd OCSInventory-Docker-Stack
sudo docker-compose build
sudo docker-compose up

This will bring up all needed containers, link them and mount data volumes according to the docker-compose.yml configuration file.

###Container shell access and viewing container logs

The docker exec command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your OCSInventory container:

sudo docker exec -it ocsinventory-server bash


sudo docker exec -it ocsinventory-db bash

You can access the logs from the container OCSInventory through Docker container log:

sudo docker logs ocsinventory-server


sudo docker logs ocsinventory-db

###Data Volume

Two volumes are created at the start of the stack OCSInventory. They contain the necessary information to ensure a proper functioning of OCS Inventory as well as MYSQL

By default:

ocsdata for the MYSQL service

  • /var/lib/mysql/

ocssrv for service OCSInventory

  • /usr/share/ocsinventory-reports/
  • /etc/ocsinventory-reports/
  • /var/lib/ocsinventory-reports/

Attention do not remove these volumes without having planned backup, otherwise you will lose your data.


  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Add your changes: git add folder/file1.php
  4. Commit your changes: git commit -m 'Add some feature'
  5. Push to the branch: git push origin my-new-feature
  6. Submit a pull request !


OCS Inventory Docker Stack is GPLv3 licensed

You can’t perform that action at this time.