# Adding Your Licence

All **Mobius**Flow® instances require a valid licence to run. Licences define the maximum number of **Mobius**Flow® objects that you can add to an instance. For more information about **Mobius**Flow® licences refer to the [Licensing](https://docs.mobiusflow.com/help/technical-docs/licencing/licensing-v1.19.1-and-later) page.

## What You Will Need?

1. A valid MobiusFlow® licence (licences can only be used on one device)

## Adding Your Licence to a BalenaCloud Device

Licences are added to balenaCloud devices by setting a device variable. All required device variables are created automatically when you deploy **Mobius**Flow® to a fleet. For more information see [Device Variables](https://docs.mobiusflow.com/help/user-guides/deploying-mobiusflow-on-prem/deploying-mobiusflow-to-approved-hardware-using-balenacloud/device-variables).

{% hint style="danger" %}
Licences must be added by **overriding a device's licence variable** and **NOT** changing the fleet's variables.
{% endhint %}

Navigate to your [balenaCloud dashboard](https://dashboard.balena-cloud.com/?) and login in

Navigate to the correct **fleet** and **device**

Select the **Device Variables** page. You will see a list of all of the device's variables with override buttons next to each variable

<figure><img src="https://241296614-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQoV8xVJhcESUhdKQWDcm%2Fuploads%2FlIczwITBNoO2t4LYOKXh%2FBalena%20Variables.png?alt=media&#x26;token=9cf1ed97-5c75-44f7-8e6c-ee2f1f125a2d" alt=""><figcaption><p>Device Variables for a device</p></figcaption></figure>

Click the **override** button next to the **MOBIUS\_LICENCE** variable

In the popup delete the text *\<replace with your licence code> and* **enter your licence code**&#x20;

Leave all other settings as their default values and click the **Add** button

<figure><img src="https://241296614-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQoV8xVJhcESUhdKQWDcm%2Fuploads%2Fi09d2BvlfvUvEHWbTuBF%2FBalena%20Set%20Licence.png?alt=media&#x26;token=17fe43a6-cc01-42a9-8496-1db2bd2ffb57" alt=""><figcaption><p>Add a licence code</p></figcaption></figure>

Your licence code will be shown in the Device Variables list (see [Device Variables](https://docs.mobiusflow.com/help/user-guides/deploying-mobiusflow-on-prem/deploying-mobiusflow-to-approved-hardware-using-balenacloud/device-variables) for more information on all of the device variables shown in this list)

**Mobius**Flow® will **restart** to install the licence&#x20;

<figure><img src="https://241296614-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQoV8xVJhcESUhdKQWDcm%2Fuploads%2FuD6FgVppsdAPYrWyAMJI%2FBalena%20Licence%20Entered.png?alt=media&#x26;token=f5c264f8-da95-412b-863a-6fba5cdf4a86" alt=""><figcaption><p>Licence entered</p></figcaption></figure>

## Updating or Replacing a Licence

{% hint style="info" %}
If you extend an expired licence or you purchase a larger licence you do not need to update the licence code
{% endhint %}

Under some circumstances it may be necessary to enter a new licence code. In order to make the new licence code work follow the procedure above to enter a new code

You will also need to tell **Mobius**Flow® to renew its licence by setting the Device Variable MOBIUS\_LICENCE\_RENEW to true

Click the **override** button next to the **MOBIUS\_LICENCE\_RENEW** variable

In the popup change the value from **false** to **true**&#x20;

Leave all other settings as their default values and click the **Add** button

Wait for **Mobius**Flow® to restart, confirm that the new licence is working and reset the Device Variable MOBIUS\_LICENCE\_RENEW to false

Click the **override** button next to the **MOBIUS\_LICENCE\_RENEW** variable

In the popup change the value from **true** to **false**&#x20;

Leave all other settings as their default values and click the **Add** button

{% hint style="success" %}
Congratulations, you have deployed your first **Mobius**Flow® device on balenaCloud.
{% endhint %}
