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

# template

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={"theme":{"light":"github-light","dark":"github-dark"}}
runpodctl template <subcommand> [flags]
```

## Alias

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

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
runpodctl tpl list
```

## Subcommands

### List templates

List available templates:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# 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={"theme":{"light":"github-light","dark":"github-dark"}}
# 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:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
runpodctl template get <template-id>
```

### Create a template

Create a new template:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Create a Pod template
runpodctl template create --name "my-template" --image "runpod/pytorch:latest"

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

<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:latest`).
</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="--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={"theme":{"light":"github-light","dark":"github-dark"}}
runpodctl template update <template-id> --name "new-name"
```

#### 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="--env" type="string">
  New environment variables as a JSON object.
</ResponseField>

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

### Delete a template

Delete a template:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
runpodctl template delete <template-id>
```

## Related commands

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