Personal tools
Namespaces

Variants
Actions

App Templates Tool

From ModulesGarden Wiki
Revision as of 12:40, 3 November 2025 by Karolina (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

About App Templates Tool

The App Templates tool allows you to manage ready-to-use application templates that clients can install directly on their virtual machines.

Templates are created in the Applications tab and grouped in the Groups tab, which can later be assigned to products.
This feature provides a simple way to manage templates and organize groups, ensuring clients can deploy preconfigured applications on their VPS with ease.

Management

The App Templates section in the admin area consists of two main parts: Applications and Groups.

You can create templates under the Applications tab and gather them into groups under the Groups tab.
For clients to install applications on their VPS, the product must include an Application Group and allow App Templates in the client area.

Applications

Read the guide carefully as it explains the key functions of the App Templates feature.

You can hide the information panel after reading by clicking the “Hide” button.

VT 19 8.png
Switch between Applications, ISO Images, Operating Systems, and Snapshots using the available tabs.

Keep in mind that the applications section differs per module. The following example comes from the Vultr VPS module.

VT 19 9.png
Use the refresh button to download and update the list of templates from your connected platform.
VT 19 10.png
Once the templates are loaded, you can use the action buttons to edit, duplicate, or delete them.

Mass action buttons are also available for bulk operations.

VT 19 11.png

Groups

After preparing your templates, group them to make them available to clients through selected products.

Go to App Templates → Groups and click on Create.

VT 19 15.png
When creating a group, provide:
  • Name
  • Description
  • Templates to include
VT 19 16.png
You can edit or delete groups individually or use mass actions to manage several at once.
VT 19 17.png
To make templates available for installation, go to the product’s module settings and select the desired groups under App Templates Configuration → Default Application Group.

Also, ensure that the App Templates option is enabled under Client Area Features.

VT 19 19.png

Advanced Configuration

The App Templates feature supports detailed configuration, including manual application addition, user-data scripting, and advanced variables.
The examples below illustrate these options.

Adding Applications Manually

1. You can manually add a single application instead of importing all templates at once.

1. Navigate to App Templates → Applications and click on Create.

VT 19 14 1.png
2. List the supported applications provided by your virtualization platform’s API.

Each platform has different API endpoints to retrieve application data.
In the case of Vultr, the command to access the list can be found in the official documentation.

Make sure to include your API Key, the request looks like this:

curl "https://api.vultr.com/v2/applications" \
 -X GET \
 -H "Authorization: Bearer ${VULTR_API_KEY}"

Example result:

{
"applications": [
{
"id": 1,
"name": "LEMP",
"short_name": "lemp",
"deploy_name": "LEMP on CentOS 6 x64",
"type": "one-click",
"vendor": "vultr",
"image_id": ""
}
3. Enter the application details such as Name, Description, Status, and optionally assign an icon.

We recommend using the name or deploy_name from the API response for easier reference.

VT 19 14 2.png
4. Edit your new application and open the Setting Details section.

Create entries based on the API output - each entry corresponds to a parameter used when deploying the application.

VT 19 14 3.png
For example, if the API returns:
"id": 1,
"image_id": "",
"user_data": ""

then create fields such as id, image_id, and optionally user_data if supported.

VT 19 14 5.png
Each field includes:
  • Name – the parameter name (same as in the API)
  • Default Value – the API’s value or your preferred default
  • Visibility – whether the client can modify the value
  • Validation – optional Laravel validation rule, e.g. `required`
VT 19 14 6.png

Including Cloud-Init / User-Data Scripts

If the selected application or system image supports user-data or cloud-init scripts, the user_data field will appear automatically.

This field lets you execute initialization tasks such as writing configuration files or running commands on first boot.

VT 19 14 7.png
Example:
#cloud-config
write_files:
 - path: /etc/motd
   content: |
     Welcome to your server, {$client.email}!

runcmd:
 - apt update
 - apt install nginx -y
VT 19 14 8.png
If Visibility is enabled, the client can modify the script before deployment. Otherwise, it will execute silently on creation.
VT 19 14 9.png

How To Use Variables

You can use merge fields (variables) to dynamically insert values into script content or configuration fields.

Supported variables depend on the module and provisioning context. Examples include:

  • {$service.id} - the WHMCS service ID
  • {$client.email} - client’s email address
  • {$password} - the generated password for the instance
  • {$hostname} - server hostname
  • {$domain} - domain name of the service

Variables can be used in any editable text field, for example:

write_files:
 - path: /etc/motd
   content: |
     Welcome to {$hostname} managed by {$client.email}!


Navigation
WHMCS Modules
WHMCS Module Bundles
WHMCS Widgets
Tools And Applications
Translations
General
FAQ
Community