# Installing Service Directly on Host

**URL:** <https://forums.balena.io/t/installing-service-directly-on-host/360660>\
**Category:** General\
**Created:** [August 16, 2022, 2:25pm UTC](https://forums.balena.io/t/installing-service-directly-on-host/360660 "2022-08-16T14:25:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![samuel\_yvon](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@samuel\_yvon](https://forums.balena.io/u/samuel_yvon)\
**Post date:** [August 16, 2022, 2:25pm UTC](https://forums.balena.io/t/installing-service-directly-on-host/360660/1 "2022-08-16T14:25:05Z")

</div>

Hi!

I’d like to know if it’s possible to install a .deb file (and if so, how) directly within the host (not in a container, my .deb requires systemd access) or if there’s a way to build a docker image that has access to systemd during buildtime (or mock values).

Unfortunately my application is closed source and is only available a service installer, which complicates my life somewhat.

---

<div class="post-metadata">

**Author:** ![fisehara](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/fisehara/32/6290_2.png) [@fisehara](https://forums.balena.io/u/fisehara)\
**Post date:** [August 16, 2022, 4:26pm UTC](https://forums.balena.io/t/installing-service-directly-on-host/360660/3 "2022-08-16T16:26:46Z")

</div>

Hello,

there is no way to load .deb files into the balena hostOS. There is the way to have access to systemd during build time, just by installing systemd to the container image.  
I’m sharing you our open-balena-base [open-balena-base/Dockerfile at master · balena-io-modules/open-balena-base · GitHub](https://github.com/balena-io-modules/open-balena-base/blob/master/Dockerfile) dockerfile as it’s a feautre rich systemd base image which is used to build open-balena-api [open-balena-api/Dockerfile at master · balena-io/open-balena-api · GitHub](https://github.com/balena-io/open-balena-api/blob/master/Dockerfile) on top of it. Open-balena-api is a systemd service and gets enabled during the buildtime.

This here is a minimal running docker-compose file content to let open-balena-api run on balenaOS with mounting access to the underlying `/run` and `/sys/fs/cgroup`

```auto
version: "2.1"
services:
  test-service-works:
    image: balena/open-balena-api:latest
    tmpfs:
    - /run
    - /sys/fs/cgroup
    cap_add:
    - SYS_ADMIN
    - SYS_RESOURCE

```

Here is also an example project showcasing the installation of systemd into a service image, that can run on baleanOS. [GitHub - balena-io-examples/balenalib-systemd-example: Example project using systemd with balenalib images](https://github.com/balena-io-examples/balenalib-systemd-example)

Please let us know if this helps you solve your service installation inside a balena container image.

Best Regards  
Harald
