App templates
An app template is a staff-curated, reusable app definition: a Docker image plus default environment variables, volume mounts, and ports. Any workspace can browse and deploy from templates. Creating, updating, and deleting templates is restricted to staff (Administrator-only).
Deploying from a template is asynchronous: the deploy endpoint returns a workflow you poll until the app is running.
List app templates
/v1/app-templatesList app templatesLists all globally available app templates with pagination. Authentication is required but any valid token may call this endpoint.
Query parameters
| Name | Type | Description |
|---|---|---|
q | string | Quick search by name, image, or ID |
name | string | Filter by template name (partial match) |
image | string | Filter by Docker image (partial match) |
category | string | Filter by category (AI, AUTOMATION, DEVOPS, GAMES, MEDIA, MONITORING, PRODUCTIVITY, ...) |
Plus the shared pagination parameters. Returns a paged list of template summaries (id, name, description, image, category).
curl -A 'curl/8.5' \
-H "Authorization: Bearer $GALAXYGATE_TOKEN" \
"https://api.galaxygate.net/v1/app-templates"Create an app template
/v1/app-templatesCreate an app templateCreates a new globally available app template. Administrator (staff) only.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Template name; must be globally unique |
description | string | yes | Short description of what this template deploys |
image | string | yes | Docker image including tag, for example plexinc/pms-docker:latest |
environment | TemplateEnv[] | Environment variable specifications (see below) | |
mounts | AppVolumeMount[] | Default volume mounts (see Apps for AppVolumeMount field details) | |
ports | TemplatePort[] | Container ports the app exposes (see below) |
TemplateEnv fields
| Field | Type | Description |
|---|---|---|
key | string | Environment variable name passed to the container |
value | string | Default value; null means the user must supply it at deploy time. May contain {{...}} placeholders (see Deploy from template) |
description | string | Short hint shown in the deploy UI |
TemplatePort fields
| Field | Type | Description |
|---|---|---|
name | string | Slug identifier for this port, unique within the template; referenced by placeholders such as {{host_port.web}} |
description | string | Short hint shown in the deploy UI |
container_port | integer | Container port the app listens on |
protocol | string | TCP or UDP |
http | boolean | Whether this port serves HTTP and can back a custom domain. At most one port per template may be marked true. |
Returns 201 Created with the full template detail view.
Fetch an app template
/v1/app-templates/{id}Fetch an app templateReturns the full configuration of an app template, including default environment variables, mounts, and ports.
Path parameters
| Name | Type | Description |
|---|---|---|
id | integer | Template ID |
Returns the full template detail view.
Update an app template
/v1/app-templates/{id}Update an app templatePartially updates an app template. Omitted fields are left unchanged. Setting a non-nullable field to null is rejected. Setting category to null clears it. Administrator (staff) only.
Path parameters
| Name | Type | Description |
|---|---|---|
id | integer | Template ID |
Request body
All fields are optional.
| Field | Type | Description |
|---|---|---|
name | string | New template name (globally unique) |
description | string | New short description |
image | string | New Docker image including tag |
category | string or null | Category to group this template under; null clears the category |
environment | TemplateEnv[] | Replacement environment variable specifications (see Create for field details) |
mounts | AppVolumeMount[] | Replacement default volume mounts |
ports | TemplatePort[] | Replacement port specifications |
Returns the updated template detail view.
Delete an app template
/v1/app-templates/{id}Delete an app templateDeletes an app template. Administrator (staff) only.
Path parameters
| Name | Type | Description |
|---|---|---|
id | integer | Template ID |
Returns 204 No Content.
Deploy an app from a template
/v1/instances/{iid}/apps/from-templateDeploy an app from a templateCreates a Docker app on the given instance using the specified template. Requires the Editor role or higher on the workspace.
At deploy time:
- Host ports default to the template's
container_portif that port is free on the target instance; otherwise a random port in the 20000-60000 range is allocated. - Environment variable values (from the template defaults and any user-supplied overrides) may contain
{{...}}placeholders that are resolved once and persisted as the final values.
Supported placeholders
| Placeholder | Resolves to |
|---|---|
{{host_port.<name>}} | Host port allocated for the template port with the given name slug |
{{container_port.<name>}} | Container port declared for the template port with the given name slug |
{{instance.ip4}} | First IPv4 address assigned to the target instance |
{{instance.ip6}} | First IPv6 address assigned to the target instance |
{{random:<length>}} | Cryptographically secure random alphanumeric string of the given length (1-128); useful for bootstrapping admin tokens or encryption keys |
Unknown placeholders or unresolvable references fail the request.
Path parameters
| Name | Type | Description |
|---|---|---|
iid | integer | Instance ID |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
template_id | string | yes | App template ID (sent as a string to preserve 64-bit precision) |
name | string | yes | App name; unique within the workspace |
environment | object | Key/value overrides merged over the template's defaults. Per-key: a string value overrides the template default; a null value removes the template's default entirely. | |
mounts | AppVolumeMount[] | When supplied, fully replaces the template's default mounts. Omit to use the template defaults unchanged. | |
domain | string | Custom domain name for the app, for example grafana.galaxygate.app; only valid when the template has a port marked http: true. |
curl -X POST -A 'curl/8.5' \
-H "Authorization: Bearer $GALAXYGATE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"template_id": "1501040853023444992",
"name": "jellyfin",
"environment": { "TZ": "America/New_York" },
"domain": "jellyfin.galaxygate.app"
}' \
"https://api.galaxygate.net/v1/instances/101/apps/from-template"Returns 201 Created with a workflow and the new app resource attached. Poll GET /v1/apps/{id} until state is AVAILABLE.