Install openhab2 and specific addons via apt-get

Good day,

is it possible to use scripts (apt-get) to install openhab, addons, etc on debain. Testing installation of openHab2 but did not see a way to install only the add-ons required via apt-get. Testing openhab in a headless environment. Would like the smallest install of openhab2 possible. Do not want any UIs installed only base and add-ons that are needed. Is using apt-get possibile to install only required components with Openhab2?

thank you

openHAB 2.x is an online installation by default, which means it will download and install the requested add-on from the internet when you ask it to.

If you were to specify what you need in /etc/openhab2/services/addons.cfg it will only download and install what you need. Hope that helps.