# Balenaos-in-container tutorial

**URL:** <https://forums.balena.io/t/balenaos-in-container-tutorial/349184>\
**Category:** Product support\
**Created:** [September 13, 2021, 10:57am UTC](https://forums.balena.io/t/balenaos-in-container-tutorial/349184 "2021-09-13T10:57:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pcorbel](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/pcorbel/32/4801_2.png) [@pcorbel](https://forums.balena.io/u/pcorbel)\
**Post date:** [September 13, 2021, 10:57am UTC](https://forums.balena.io/t/balenaos-in-container-tutorial/349184/1 "2021-09-13T10:57:51Z")

</div>

Hello everyone 👋,

I wanted to share what I’ve achieved as of now (Septembre, 13th 2021) with the official (and new) balenaos-in-container v1.0.0 image.

# ssh onto a fresh installed debian buster instance

# login as root

```bash
sudo su - root

```

# install system dependencies

```bash
apt-get update
apt-get install --yes docker.io docker-compose wget unzip

```

# setup balenaos-in-container

```bash
git clone https://github.com/balena-os/balenaos-in-container.git
echo '{"deviceType": "intel-nuc","localMode": true,"persistentLogging": false}' > ~/balenaos-in-container/config.json
docker-compose --project-directory ~/balenaos-in-container -f ~/balenaos-in-container/docker-compose.yml up --detach

```

# check that the container is up and running

```bash
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1498efb58a8d balenaos-in-container_os "/entry.sh" 3 hours ago Up 3 hours balenaos-in-container_os_1

```

# setup balena-cli

```bash
wget https://github.com/balena-io/balena-cli/releases/download/v12.48.11/balena-cli-v12.48.11-linux-x64-standalone.zip
unzip balena-cli-v12.48.11-linux-x64-standalone.zip
rm balena-cli-v12.48.11-linux-x64-standalone.zip
alias balena=~/balena-cli/balena
balena login

```

# find the ip address of the supervisor

```bash
balena scan
Scanning for local balenaOS devices... Reporting scan results
- 
  host: 5850a07.local
  address: 172.17.0.2 <---------- there it is!
  osVariant: development
  dockerInfo: 
    Containers: 1
    ContainersRunning: 1
    ContainersPaused: 0
    ContainersStopped: 0
    Images: 2
    Driver: overlay2
    SystemTime: 2021-09-13T12:00:23.2713827Z
    KernelVersion: 4.19.0-17-cloud-amd64
    OperatingSystem: balenaOS 2.58.6+rev1 (containerized)
    Architecture: x86_64
  dockerVersion: 
    Version: 19.03.13-dev
    ApiVersion: 1.40

```

# setup your project locally and push it

```bash
git clone <my_fleet>
cd <my_fleet>
balena push <supervisor_ip_address>

```

You should be good to go

---

<div class="post-metadata">

**Author:** ![dtischler](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/dtischler/32/2483_2.png) [@dtischler](https://forums.balena.io/u/dtischler)\
**Post date:** [September 13, 2021, 10:11pm UTC](https://forums.balena.io/t/balenaos-in-container-tutorial/349184/2 "2021-09-13T22:11:46Z")

</div>

Nice work here @pcorbel! Thanks for the tutorial!
