---
title: Templates
slug: edgemanager/lem-user-guide/manage-edge-devices/templates
description: Templates allow you to create a template from an edge device or upload a template from a file for your edge devices from the Templates pane.
docTags: 
createdAt: 2022-03-30T21:44:17.000Z
---

A template is a JSON file containing configuration settings for a Litmus Edge device. The **Templates&#x20;**&#x70;age provides a centralized location for creating, organizing, and deploying these configurations.

You can access all templates available for an instance, an open company, or an open project here. You can create a template from an online edge device, or upload a template from a file, for an edge device after you have selected a company and opened a project. You can add templates at three levels:

- **Instance**: Upload from the Admin Console.
- **Company**: Upload from a file.
- **Project**: Upload from a file, or create one from an edge device.

Templates for edge devices can include devices, analytics, flows, and connectors. You can make selections for these categories when creating a template from an edge device.

:::hint{type="info"}
**Important**: Before you can create a template from a device, you must add at least one online edge device in **Edge Devices**.
:::

Templates can be scoped at three levels:

- **Instance**: Available to all companies in this Litmus Edge Manager (LEM) instance.
- **Company**: Available to all projects in this company.
- **Project**: Available only to this project.

You can select the scope for a template when you upload. For example, if you upload a template from the **Company** > *Templates* pane, the template is accessible to all the projects for that company. If you upload a template from a **Project** *Templates* pane, the template is accessible to only that project.

When you modify a template, you can modify the scope by selecting **Company** or **Project** in the *Edit Template* dialog box.

You can apply, modify, parameterize, download, and remove a template from the *Templates* pane.

Templates support apply modes, validation checks, in-template parameters, and restore. These aren't limited to a separate category of template - every template uploaded through **Load Template from File**'s **Simple Template** option supports them, subject to the template's schema version (see "Applying a template" and "Reusable values (parameters)" below). **Parameterized Template** (.zip) is a separate, older mechanism for adding substitutable variables to a template, with its own editor - see [Parameterize a Template](docId\:C82odk04Fv79__nRtuwNZ) and [Apply a Parameterized Template](docId\:hGXk9Kz0RYk75Mvd0z_3S) for that workflow.

You can use a single JSON file, provide different values for different devices or sites, check the template before applying it, and apply it to one device, several devices, or a device group. You can also review the template contents, choose an apply mode, and restore a saved device configuration after supported apply operations.

![Solution template lifecycle](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/Zp9WzNrh5rG3-Be5_F-_M_solutiontemplatelifecycle-1.png)

## Access Template

You can access company-level templates and project-level templates.&#x20;

**To access company-level templates**:

1. Log in to Litmus Edge Manager.
2. Select a company.
   The *Projects* pane appears.
3. From the *Navigation&#x20;*&#x70;anel, select **Templates**.
   The *Templates&#x20;*&#x70;ane for the company appears.

**To access project-level templates:**

1. Log in to Litmus Edge Manager.
2. Select a company.
   The *Projects* pane appears.
3. From the *Projects&#x20;*&#x70;ane, click a project tile.&#x20;
   The *Dashboard&#x20;*&#x70;ane appears for the project.
4. From the *Navigation&#x20;*&#x70;anel, select **Templates**.
   The *Templates&#x20;*&#x70;ane for the project appears.

## Litmus Edge Manager 2.32.0 and higher

&#x20;From the *Templates&#x20;*&#x70;ane, you can use the icons at the top right to:

- Filter templates by description
- Create a template from an edge device
- Create a template from a file
- Reload the template list

### Template Statistics

To view detailed information about a template, click **Show template content** in a template row to display the **Template & Log Details&#x20;**&#x70;anel. The panel contains three collapsible sections: Details, Template Content, and Log.

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/9vPjAHGLv2Bx5wg400UTn_image.png)

- **Details**: Displays basic information about the template, including its created and modified timestamps.
- **Template Content**: Displays all components included in the template, to provide a quick overview of what the template provisions when applied. Expand a category to see the names of individual items. When you create or import a template, you choose the settings to include from a set of categories. Categories include:&#x20;
  - **OPC UA**: OPC UA configuration.
  - **Device Management**: settings such as dns, ntp, country, timezone, dockerConfig, firewall, and proxy.
  - **Auth**: authentication configuration.
  - **Marketplace**: Marketplace apps and configuration.
  - **Analytics**: analytics flows and processors.
  - **Digital Twin**: Digital Twins models and instances.
  - **Cloud Storage**: cloud storage configuration.
  - **System Info**: system information and application configuration.
- **Parameters**: Displays the template's parameters, grouped by component, if it has any. Only templates with a schema version of 2 or higher can have parameters, entered outside LEM before the template is uploaded. See **Applying a template** below for how you supply values when applying the template.

  ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/bI80sFiQQGYloq79G56P6_image.png" size="60" width="631" height="367" position="flex-start" darkWidth="631" darkHeight="367" showCaption="false"}
- **Log**
  Audit history of significant actions including edits and deployments. View the time of the action, severity level, user who performed the action, and event type.

  ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/_cp9lveNVISrvF7eQEXSW_image.png" size="60" width="634" height="175" position="flex-start" darkWidth="634" darkHeight="175" showCaption="false"}

A template file is a single JSON file. Alongside your selected settings, it records details like the template's schema version and information about the source device, for example:

```json
   {
    "version": "2.0.0",
    "createdAt": "...",
    "updatedAt": "...",
    "stats": {
      "timeseries_db": { "enabled": true, "source": "internal" },
      "version": { "Git": "ca5c1e6b47", "Version": "2.5.4" }
    }
  }
```

### Applying a template

Templates support the following apply modes:

- **Reset & Apply**: Clears all existing configurations and replaces them entirely with the selected template.
- **Merge & Apply**: Combines the template with your current setup. Objects with existing IDs are overwritten, and objects with new IDs are appended, within all components.
- **Apply**: Uses the standard system logic to integrate the template. Overwriting and appending rules are determined at the component level.

Before applying a template, LEM checks that the JSON file is valid, that references in the file are valid, and that the target device has the required connectors and drivers.

LEM checks a template twice: once when you import it and again when you apply it. On import, LEM confirms the file is valid JSON and that everything it refers to is included in the same file. For example, a Digital Twin instance must include the model it uses. On apply, LEM confirms the target device has the connectors and drivers the template needs. If either check fails, LEM reports the problem and doesn't proceed. This is separate from the earlier check from a per-item failure during the apply itself. LEM continues applying the rest of the template instead of stopping.

To apply a template:

1. In the *Templates* pane, open the template's action menu and select **Apply Template**.
2. On **Select edge devices**, select one or more target devices, then select **Next**. A device that can't receive the template shows the reason inline in an **Info** column instead of being selectable.
3. On **Application mode**, select **Reset & Apply**, **Merge & Apply**, or **Apply**, then select **Next**.

![Apply Template](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/SRptoggsk5rnPBBOGpKJV_solutiontemplate-7.png)

1. If the template has parameters, LEM shows a **Parameters** step: "Fill in the parameter values for the components in this template." Parameters are grouped by component, each with an editable **Value** field pre-filled with its default. Update any values you need, then select **Next**.
2. On **Review**, check the summary, type **I understand** to confirm, then select **Apply**. LEM shows the result for each device and confirms when the apply finishes. Select **Finish** to close the wizard.

Review these behaviors before applying a template:

- Flows in the template can replace existing flows on the device, depending on the apply mode.
- If a connector in the template shares a name with an existing one, LEM adds the new one under a different name instead of overwriting the original.
- With **Reset & Apply**, device tags that aren't in the template are removed.
- If one part of a template fails to apply, LEM keeps applying the rest.
- If the template has protected passwords, save the encryption key. You need it to import the template again.

:::hint{type="info"}
**Note:** Starting with LEM 2.33.0, Litmus Edge templates are synchronized with encrypted credentials by default to keep secrets out of source control in LEM templates and Git. Templates support encrypted credentials beginning with Litmus Edge 4.0.4.&#x20;
:::

### Reusable values

A template's JSON file can declare named, typed parameters for the components it targets, such as a site identifier or a Digital Twin model name, letting one template's values be adjusted per device or site instead of being fixed in the file.

Only templates with a schema version of 2 or higher support this. You can't create or edit these parameters in the *Templates* pane; the parameterized JSON is prepared outside LEM and uploaded like any other template, through the same **Simple Template** upload option. When you apply a template that has parameters, LEM shows them in the apply wizard's own **Parameters** step, grouped by component, each pre-filled with its default value and editable before you continue.

### Saved configurations and restore

Before **Reset & Apply&#x20;**&#x6F;r **Merge & Apply&#x20;**&#x63;hanges a device, LEM saves that device's current configuration. If the result isn't what you expected, you can restore the device from this saved configuration.

### Tracking, visibility, and reporting

LEM logs template activity, including creating, importing, editing, deleting, downloading, and applying templates. Each entry shows who did it, when, and the result. A template's details also show which devices or groups use it, its version, and the result of its last apply.

## Limitations and considerations

- Apply modes, the apply preview, and in-template parameters require Litmus Edge Manager (LEM) 2.32.0 or later, and LE 4.3.0 or later on the target device.
- You cannot apply only selected parts of a template or combine two templates in this release.
- Saved configurations use storage and do not expire automatically.
- Templates that include Marketplace settings might not work on builds without Docker support.

## Litmus Edge Manager 2.11.0 to 2.31.1

Refer to the following actions you can take on the Litmus Edge Manager User UI's *Templates* pane. The user interface below is for Litmus Edge Manager version 2.11.0 and later.

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/WJb-uw_zUozliRx6INHKa_lidbfeimg2onr4btewsmnimage.png "Templates \[Company View]")

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/d9pQ2rPF2w_4HK9adiknN_edft4iukcpye7alfrvo2bimage.png "Templates \[Project View]")

| **Action**                                                    | **Details**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \[1] **Show filter**                                          | Search templates by name or description.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| \[2] **Create Template from Device**                          | Capture a source device's current configuration as a new template. Opens the Create wizard: select the source device, then choose which settings to include from the categories listed in Template statistics, name the template, and optionally turn on **Encrypt template**. Requires at least one connected edge device.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| \[3] **Load Template from File**                              | Upload a template file. Choose **Simple Template**<br /> to upload a template as a JSON file, or **Parameterized Template** to upload a ZIP file. Both options let you name the template and, for a template created with encryption on, provide the encryption key.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| \[4] [Parameterize a Template](docId\:C82odk04Fv79__nRtuwNZ)  | Convert an existing template into a Parameterized Template by adding variables to selected attributes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| \[5] **Actions**                                              | - **Apply Template**: Apply a template to one or more target devices using an apply mode (**Reset & Apply**, **Merge & Apply**, or **Apply**)**&#x20;&#x20;**<br />- [Apply a Parameterized Template](docId\:vvqsGGxbG3bj5u1qYVdcV)<br />- [Apply a Parameterized Template During Activation](docId\:hGXk9Kz0RYk75Mvd0z_3S)<br />- **Edit Template:&#x20;**&#x41;pply Template. Template scope cannot be changed from *Company* to *Project.*<br />- [Parameterize a Template](docId\:C82odk04Fv79__nRtuwNZ): Convert an existing template into a Parameterized Template by adding variables to selected attributes.<br />- **Download Template:&#x20;**&#x44;ownload the template as a file. A download from the company-level view contains every project's templates for that company; a download from the project-level view contains only that project's templates. If the template contains protected passwords, the downloaded file keeps them encrypted, and you need the encryption key to use the file again.<br />- **Delete:&#x20;**&#x44;elete removes the template. Download a template before deleting it if you might need to re-upload it later. |
| \[6] **View Template Statistics**                             | View usage information for a template.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

## Next steps

- [Parameterize a template](docId\:C82odk04Fv79__nRtuwNZ)
- [Apply a parameterized template](docId\:vvqsGGxbG3bj5u1qYVdcV)
- How-to guide: [Apply parameterized template during activation](docId\:hGXk9Kz0RYk75Mvd0z_3S)

