Skip to content

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

GET/v1/app-templatesList app templates

Lists all globally available app templates with pagination. Authentication is required but any valid token may call this endpoint.

Query parameters

NameTypeDescription
qstringQuick search by name, image, or ID
namestringFilter by template name (partial match)
imagestringFilter by Docker image (partial match)
categorystringFilter 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).

bash
curl -A 'curl/8.5' \
  -H "Authorization: Bearer $GALAXYGATE_TOKEN" \
  "https://api.galaxygate.net/v1/app-templates"

Create an app template

POST/v1/app-templatesCreate an app template

Creates a new globally available app template. Administrator (staff) only.

Request body

FieldTypeRequiredDescription
namestringyesTemplate name; must be globally unique
descriptionstringyesShort description of what this template deploys
imagestringyesDocker image including tag, for example plexinc/pms-docker:latest
environmentTemplateEnv[]Environment variable specifications (see below)
mountsAppVolumeMount[]Default volume mounts (see Apps for AppVolumeMount field details)
portsTemplatePort[]Container ports the app exposes (see below)

TemplateEnv fields

FieldTypeDescription
keystringEnvironment variable name passed to the container
valuestringDefault value; null means the user must supply it at deploy time. May contain {{...}} placeholders (see Deploy from template)
descriptionstringShort hint shown in the deploy UI

TemplatePort fields

FieldTypeDescription
namestringSlug identifier for this port, unique within the template; referenced by placeholders such as {{host_port.web}}
descriptionstringShort hint shown in the deploy UI
container_portintegerContainer port the app listens on
protocolstringTCP or UDP
httpbooleanWhether 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

GET/v1/app-templates/{id}Fetch an app template

Returns the full configuration of an app template, including default environment variables, mounts, and ports.

Path parameters

NameTypeDescription
idintegerTemplate ID

Returns the full template detail view.

Update an app template

PATCH/v1/app-templates/{id}Update an app template

Partially 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

NameTypeDescription
idintegerTemplate ID

Request body

All fields are optional.

FieldTypeDescription
namestringNew template name (globally unique)
descriptionstringNew short description
imagestringNew Docker image including tag
categorystring or nullCategory to group this template under; null clears the category
environmentTemplateEnv[]Replacement environment variable specifications (see Create for field details)
mountsAppVolumeMount[]Replacement default volume mounts
portsTemplatePort[]Replacement port specifications

Returns the updated template detail view.

Delete an app template

DELETE/v1/app-templates/{id}Delete an app template

Deletes an app template. Administrator (staff) only.

Path parameters

NameTypeDescription
idintegerTemplate ID

Returns 204 No Content.

Deploy an app from a template

POST/v1/instances/{iid}/apps/from-templateDeploy an app from a template

Creates 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_port if 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

PlaceholderResolves 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

NameTypeDescription
iidintegerInstance ID

Request body

FieldTypeRequiredDescription
template_idstringyesApp template ID (sent as a string to preserve 64-bit precision)
namestringyesApp name; unique within the workspace
environmentobjectKey/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.
mountsAppVolumeMount[]When supplied, fully replaces the template's default mounts. Omit to use the template defaults unchanged.
domainstringCustom domain name for the app, for example grafana.galaxygate.app; only valid when the template has a port marked http: true.
bash
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.