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/sampleextensionfolder must be placed in the server'sextensionsfolder.The
frontend/sampleextensionfolder, if present, must be placed inpublic/extensions.
If OCS Inventory was installed from the .deb or .rpm packages, these two locations already exist by default:
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:
Install it - this registers the extension and sets up whatever it needs (database tables, etc.).
Enable it - this switches it on.
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.
Command reference
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.
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:
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.
disable
Turns off an extension without removing it. The extension stays installed and can be re-enabled at any time.
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.
Add --erase-data if you also want to permanently delete the extension's data:
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.
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.
Add --redo only if you want to reset the extension's setup from scratch:
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.
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

