Have you ever shared an open source IoT project only to be overwhelmed with questions about how to deploy it, or underwhelmed with the lack of adoption by the community? Even if you labor over your README instructions, it can be hard to make device provisioning and deployments simple and repeatable.
Deploy with balena capability lets you automate those steps so your project users can skip all the prerequisites and just push your code. The easier it is to successfully set up and use your project, the more likely users will share it!
What is Deploy with balena?
If you’ve ever used a public cloud service, you’ve seen this sort of simplicity with automated deployments and containers. Balena brought containers to IoT devices and created a complete ecosystem for managing them, but there was still a distance to cross to get the same sort of “one-click” workflows. The
Deploy to balena button is our latest feature, designed to close the gap for open-source projects aimed at single-board computers.
Instead of lengthy instructions, you add a simple code snippet to your project web page or GitHub README that instantly transports your users to the balenaCloud platform, where they can create a free account and deploy your app. Your code and default configurations are pushed to their devices automatically. Every device you add will also use these configurations if you or your users plan to scale up your fleets.
Users don’t need to preconfigure their devices, either. They just download the base balenaOS image, add WiFi credentials (another well-known pain-point balena has solved), and use balenaEtcher to flash it to a device or SD card. As soon as the device boots, it’s automatically added to the balenaCloud app dashboard, your code is downloaded to the user’s device and starts running.
Your users can then use the balenaCloud dashboard to set or reset environment variables that customize the behaviour of the device, wherever it is. It can be right next to them or in a treetop halfway around the world. They don’t need to touch the device itself or tamper with the SD card or eMMC. You can even save them these steps by setting all the necessary environment variables in a simple balena.yml file you place in the root of your GitHub repo.
Simplify the redeployment process
As you update your code and make improvements, your users can push the latest version of your project just as easily. With
Deploy with balena, users can redeploy your latest code to an existing balenaCloud application. No need to reprovision a device, install special tools, use the command line, or manually reset environment variables.
If your users want to provision multiple devices, they can just flash the same OS image they downloaded to as many devices as they want. balenaOS does the hard work of provisioning, setting unique identities and maintaining secure connections, regardless of whether your users are relying on WiFi, Ethernet, cellular or a mix.
How to set up GitHub apps to use Deploy with balena
You can get started by adding a single line of code to your GitHub README:
We typically use this markdown example, but you can use the deploy link how you want in your readme.
Or add a link with the repo URL to any web page:
In that example, our repo is the balenaDash project. Replace that
repoURL with the URL to your desired repo.
You can use our button graphic, found here:
As an example, in our balena-dash project, a
balena.yml file has been added to provide configuration and environment variables:
applicationConfigVariables: - BALENA_HOST_CONFIG_gpu_mem: 128 applicationEnvironmentVariables: - CONFIG_MODE: 0 - LAUNCH_URL: https://www.yout-ube.com/watch?v=08lH_hxug28 - SHOW_CURSOR: 0 - CONTROL_TV: 0
These values get automatically populated in the modal window:
Today, there are already nearly 50 examples of balena and community projects with these
Deploy with balena features built in. That means each application can be deployed to one or more devices in moments — with no complicated README to follow.
Some balenaLabs examples:
- balena-sound — Build a single or multi-room streamer for an existing audio device using a Raspberry Pi
- balena-sense — Take sensor readings, store them in InfluxDB and view them with Grafana
balena-dash — Build a desktop dashboard for stats, photos, videos, and more
- balena-locating — Use Bluetooth Low Energy (BLE) beacons and Raspberry Pi sensors to track your stuff
- wifi-repeater — Easily create a WiFi Access Point or repeater
Some community examples:
- kerberos-balena — Make a security camera system in 30 minutes or less
- balena-minecraft-server — Create a Minecraft Server using just a Raspberry Pi
- Pi-hole — Create a network-wide ad blocker
- octobalena — Remotely control your 3D printers with balenaCloud and Octoprint
Keep watching this space
This is just the first version of the
Deploy to balena button. Our team is hard at work on building in new features with the goal of closing the gap for open-source projects using single-board computers.
There’s always more room for improvement, so if you’ve tried it, let us know what you think on our Forums or Twitter. With
Deploy to balena and the entire balena ecosystem, you can stop worrying about the basics like maintaining your own OS, solving the provisioning workflow, or figuring out fleet management, and just focus on making your app awesome — and easy for your users to deploy!