For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Managing Extensions

Extension folder layout

An extension is made of up to two subfolders, a mandatory backend one and an optional frontend one, that get deployed to two different locations on the server. For an extension named sampleextension:

sampleextension/
├── backend/sampleextension/    (mandatory)
└── frontend/sampleextension/   (optional)
  • The backend/sampleextension folder must be placed in the server's extensions folder.

  • The frontend/sampleextension folder, if present, must be placed in public/extensions.

If OCS Inventory was installed from the .deb or .rpm packages, these two locations already exist by default:

Component
Default base directory
Extensions go in

Backend

/usr/share/ocsinventory-backend

/usr/share/ocsinventory-backend/extensions

Frontend

/usr/share/ocsinventory-frontend

/usr/share/ocsinventory-frontend/public/extensions

Once both folders are in place, the extension is ready to be installed.

Installing and managing an extension

Once an extension has been placed on the server (typically by copying its backend/<name> folder into the extensions directory and its frontend/<name> folder into public/extensions if it has one), it goes through a simple lifecycle:

  1. Install it - this registers the extension and sets up whatever it needs (database tables, etc.).

  2. Enable it - this switches it on.

  3. Restart the application server - extensions build their routes when the server starts, so a restart is what makes an install/enable/disable actually visible to users.

All of this lifecycle is managed with a single command, run from the server:

You can also enable or disable an extension from the web console, it does exactly the same thing as the enable / disable commands below, just with a click instead of a command line.

New to extensions ? See the Introduction page for an overview of how the extension system works.

Command reference

Command
What it does

list

Shows every extension found on the server and its current state

install <name>

Registers a new extension and prepares it for use

enable <name>

Turns an installed extension on

disable <name>

Turns an extension off

uninstall <name>

Removes an extension from the server's registry

check-migrations

Checks that everything is set up correctly, without changing anything

apply-migrations <name>

Re-applies an extension's setup (useful after an update)

clean <name>

Cleans up leftovers after an extension's files were deleted manually

list

Shows every extension the server knows about, along with a short status for each one (e.g. ok, not installed, disabled). Use this first whenever you want a quick overview, or to check whether an extension is behaving as expected.

Example output

install

Registers a new extension so the server can use it, and prepares anything it needs to run (such as its database tables). This is the first command to run after placing a new extension's files on the server.

Add --enable to switch the extension on in the same step:

Example output

Installing a brand-new extension requires the server process to restart itself once, this happens automatically as part of the command, you don't need to do anything extra. You will still need to restart your application server(s) afterwards for the extension's pages and routes to show up for users.

enable

Turns on an extension that has already been installed. Does the same thing as flipping the toggle in the web console.

Example output

After enabling (or disabling) an extension, restart your application server so the change actually takes effect for users.

disable

Turns off an extension without removing it. The extension stays installed and can be re-enabled at any time.

Example output

uninstall

Removes an extension from the server's registry and turns it off. By default this keeps the extension's data intact, in case you reinstall it later.

Example output

Add --erase-data if you also want to permanently delete the extension's data:

Example output

Uninstalling does not delete the extension's files from the server — do that separately (and restart your application server) once you're sure you no longer need it.

check-migrations

A read-only health check: it verifies that every installed extension is set up correctly, without changing anything. Useful for troubleshooting, or as a routine check after updates.

Example output

You can also target a single extension:

apply-migrations

Re-applies an extension's setup. You'll mainly need this after updating an extension to a new version that changed its database structure.

Example output

Add --redo only if you want to reset the extension's setup from scratch:

Example output

clean

A cleanup tool for one specific situation: an extension's folder was deleted from the server directly (instead of using uninstall first), and some leftovers remain in the server's records. Running clean removes those leftovers.

Example output

If this extension left its own database tables behind, clean will list them but won't delete the data in them automatically, this is a deliberate safety measure. The command's output will tell you what to do if you want to remove them.

Typical workflows

Installing and enabling a new extension

Then restart your application server(s).

Checking that everything is healthy

Turning an extension off temporarily

Then restart your application server(s).

Removing an extension for good, including its data

Then delete its files from the server and restart your application server(s).

Last updated