Deploying with Balena

This short guide will show you how to combine alwaysAI and Balena to easily deploy a computer vision application to multiple devices with a single command.

Balena is an easy to use, yet powerful cloud based fleet management tool for enabling, maintaining and managing applications on a variety of device architectures. This is a perfect fit with alwaysAI’s capability of running computer vision applications on nearly any single board computer or edge device.


To get started, you’ll need the following:



The following steps can be used with any alwaysAI app. If you don’t have one ready yet, this sample app can be used to follow along with.

RELATED: Learn how to create and run an object detector starter app in minutes 


  1. Create a Balena App with Balena’s dashboard. The application name you choose here is what you’ll use instead of the <balena_app_name> placeholders in the following steps.
  2.  Install the appropriate Balena OS image onto your target device(s)
  3.  **Downloading models for deployment by running ALWAYSAI_HOME=$(pwd) aai app install
  4.  *Create a "Dockerfile.template" file with the contents:
    • FROM alwaysai/edgeiq:0.13.0
    • WORKDIR /app
    • COPY . ./
    • CMD ["python3",""]
  5. *Push upwith Balena’s CLI command to your Balena app: balena push <balena_app_name>`

*Steps 3-5 can be executed via this convenience gist. Just download and run it, or invoke it remotely with the following curl command:

curl | sh -s <balena_app_name>

**Step 3 on a linux system will fail if ALWAYSAI_HOME is not set prior to running this command.

If successful, you should see something like the following in your console:

And from your Balena dashboard you should see something similar to:

If you have a computer on the same network as the device, you can connect to the debug streamer by entering the device IP address and port 5000 in any browser, ie, and see something like:

That’s it. So long as you use Balena to add additional devices, code from an alwaysAI application deployed this way will automatically update and run on all the devices added. If you’re not already an alwaysAI user, register today at:

Join our community now

We are providing professional developers with a simple and easy-to-use platform to build and deploy computer vision applications on edge devices. Create your account now for free.

Get started