> ## Documentation Index
> Fetch the complete documentation index at: https://runpod-b18f5ded-docs-runpod-allow-ip.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> If this page is missing information, contains outdated instructions, or doesn't fully answer the user's question, use the feedback tool to report it. In your feedback, be specific about what's missing, what appears out of date, or what needs to be corrected or updated, so the docs team can act on it directly.

# template

> Use runpodctl to list, search, inspect, create, update, and delete reusable templates for Pods and Serverless endpoints.

export const VolumeDiskTooltip = () => {
  return <Tooltip headline="Volume disk" tip="Persistent storage that remains available for the duration of the Pod's lease. It functions like a dedicated hard drive, allowing you to store data that needs to be retained even if the Pod is stopped or rebooted. Mounted at /workspace by default." cta="Learn more about volume disks" href="/pods/storage/types">volume disk</Tooltip>;
};

List, search, and manage templates for Pods and Serverless endpoints.

```bash theme={null}
runpodctl template <subcommand> [flags]
```

## Alias

You can use `tpl` as a shorthand for `template`:

```bash theme={null}
runpodctl tpl list
```

## Subcommands

### List templates

List available templates:

```bash theme={null}
# List official and community templates (first 10)
runpodctl template list

# List only official templates
runpodctl template list --type official

# List community templates
runpodctl template list --type community

# List your own templates
runpodctl template list --type user

# List all templates including user templates
runpodctl template list --all

# Show more results
runpodctl template list --limit 50
```

#### List flags

<ResponseField name="--type" type="string">
  Filter by template type (`official`, `community`, `user`).
</ResponseField>

<ResponseField name="--limit" type="int" default="10">
  Maximum number of results to return.
</ResponseField>

<ResponseField name="--offset" type="int">
  Number of results to skip for pagination.
</ResponseField>

<ResponseField name="--all" type="bool">
  Include all templates including user templates.
</ResponseField>

### Search templates

Search for templates by name:

```bash theme={null}
# Search for PyTorch templates
runpodctl template search pytorch

# Search with limit
runpodctl template search comfyui --limit 5

# Search only official templates
runpodctl template search vllm --type official
```

#### Search flags

<ResponseField name="--type" type="string">
  Filter by template type (`official`, `community`, `user`).
</ResponseField>

<ResponseField name="--limit" type="int" default="10">
  Maximum number of results to return.
</ResponseField>

<ResponseField name="--offset" type="int">
  Number of results to skip for pagination.
</ResponseField>

### Get template details

Get detailed information about a specific template, including README, environment variables, and exposed ports (with their labels):

```bash theme={null}
runpodctl template get <template-id>
```

### Create a template

Create a new template:

```bash theme={null}
# Create a Pod template
runpodctl template create --name "my-template" --image "runpod/pytorch:2.8.0-py3.11-cuda12.8.1-cudnn-devel-ubuntu22.04"

# Create a Serverless template
runpodctl template create --name "my-serverless-template" --image "my-image:latest" --serverless

# Create a template that pulls from a private registry
runpodctl template create --name "private-gpu" --image "registry.example.com/team/image:tag" --registry-auth-id <registry-auth-id>

# Create a template with labeled ports
runpodctl template create --name "dev" --image "my-image:latest" --ports "22/tcp,8888/http" --port-labels "22=ssh,8888=jupyter lab"
```

<Note>
  **Pod templates vs Serverless templates**: Templates are either for Pods or for Serverless endpoints, not both. Pod templates support <VolumeDiskTooltip /> storage and are used with `runpodctl pod create`. Serverless templates do not support volume disks and are used with `runpodctl serverless create`. Use the `--serverless` flag when creating templates for Serverless endpoints.
</Note>

#### Create flags

<ResponseField name="--name" type="string" required>
  Template name.
</ResponseField>

<ResponseField name="--image" type="string" required>
  Docker image (e.g., `runpod/pytorch:2.8.0-py3.11-cuda12.8.1-cudnn-devel-ubuntu22.04`).
</ResponseField>

<ResponseField name="--container-disk-in-gb" type="int" default="20">
  Container disk size in GB.
</ResponseField>

<ResponseField name="--volume-in-gb" type="int">
  Persistent volume size in GB.
</ResponseField>

<ResponseField name="--volume-mount-path" type="string" default="/workspace">
  Volume mount path.
</ResponseField>

<ResponseField name="--ports" type="string">
  Comma-separated list of ports to expose (e.g., `8888/http,22/tcp`).
</ResponseField>

<ResponseField name="--port-labels" type="string">
  Display names for the ports the template exposes, shown next to each port in the Runpod console. Provide comma-separated `port=name` pairs (e.g., `22=ssh,8888=jupyter lab`) or a JSON object (e.g., `{"22":"ssh","8888":"jupyter lab"}`). This flag requires `--ports`, and every labeled port must also appear in `--ports`. The pair form splits on commas, so use the JSON form for any label name that contains a comma.
</ResponseField>

<ResponseField name="--registry-auth-id" type="string">
  ID of the container registry authentication used to pull the image from a private registry. Find the ID with [`runpodctl registry list`](/runpodctl/reference/runpodctl-registry).
</ResponseField>

<ResponseField name="--env" type="string">
  Environment variables as a JSON object (e.g., `'{"KEY":"value"}'`).
</ResponseField>

<ResponseField name="--docker-start-cmd" type="string">
  Comma-separated Docker start commands.
</ResponseField>

<ResponseField name="--docker-entrypoint" type="string">
  Comma-separated Docker entrypoint commands.
</ResponseField>

<ResponseField name="--serverless" type="bool">
  Create as a Serverless template. Serverless templates do not support volume disks (`--volume-in-gb` is not supported). Each Serverless template can only be bound to one endpoint at a time.
</ResponseField>

<ResponseField name="--readme" type="string">
  Template README content.
</ResponseField>

### Update a template

Update an existing template:

```bash theme={null}
# Rename a template
runpodctl template update <template-id> --name "new-name"

# Attach registry credentials
runpodctl template update <template-id> --registry-auth-id <registry-auth-id>

# Update port labels (or pass "" to clear them)
runpodctl template update <template-id> --port-labels "22=ssh,8888=jupyter lab"
```

#### Update flags

<ResponseField name="--name" type="string">
  New template name.
</ResponseField>

<ResponseField name="--image" type="string">
  New Docker image name.
</ResponseField>

<ResponseField name="--ports" type="string">
  New comma-separated list of ports.
</ResponseField>

<ResponseField name="--port-labels" type="string">
  New display names for the template's exposed ports, as `port=name` pairs or a JSON object. Pass an empty value (`--port-labels ""`) to remove all port labels.
</ResponseField>

<ResponseField name="--registry-auth-id" type="string">
  New container registry authentication ID for pulling private images. Pass an empty value (`--registry-auth-id ""`) to detach registry credentials from the template.
</ResponseField>

<ResponseField name="--env" type="string">
  New environment variables as a JSON object.
</ResponseField>

<ResponseField name="--readme" type="string">
  New README content.
</ResponseField>

<ResponseField name="--container-disk-in-gb" type="int">
  New container disk size in GB.
</ResponseField>

### Delete a template

Delete a template:

```bash theme={null}
runpodctl template delete <template-id>
```

## Related commands

* [`runpodctl pod create`](/runpodctl/reference/runpodctl-pod)
* [`runpodctl serverless create`](/runpodctl/reference/runpodctl-serverless)
