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

# Choosing a Template

> Select the right template for your Vast.ai instance. Templates define your Docker image, launch mode, and initialization settings.

## What are Templates?

Templates are saved configurations that define how your instance will be set up. Every instance on Vast.ai requires a template that specifies:

* **Docker image** - The base container environment
* **Launch mode** - How you'll connect (SSH, Jupyter, or Entrypoint)
* **Initialization** - Startup scripts and environment variables
* **Ports and networking** - Required network configurations

<Note>
  For comprehensive template documentation including creating custom templates, see the main [Templates section](/guides/templates/introduction).
</Note>

## Selecting a Template

When renting an instance, you must select a template first. You have three options:

### 1. Recommended Templates

Pre-configured templates for common use cases:

* **PyTorch** - Ready for deep learning with Jupyter
* **TensorFlow** - ML development environment
* **Stable Diffusion** - Image generation UIs
* **LLM Inference** - Text generation setups
* **Base Ubuntu** - Clean development environment

### 2. Your Recent Templates

Templates you've previously used or customized are saved for quick access.

### 3. Custom Templates

Create your own or modify existing templates to match your exact needs.

## Quick Template Selection

1. On the [search page](https://cloud.vast.ai/create/), look for the template selector in the upper left
2. Click "Change Template" to see available options
3. Select a template that matches your needs
4. The search will update to show compatible machines

<Tip>
  Start with a recommended template and modify it rather than creating from scratch. This ensures compatibility and faster startup times.
</Tip>

## Launch Modes

Templates support three connection methods:

### SSH

* Terminal access via SSH
* Best for: Development, training scripts, command-line work
* Includes tmux session management

### Jupyter

* Web-based notebook interface
* Best for: Data science, experimentation, visualization
* Includes terminal access

### Entrypoint

* Runs Docker's native entrypoint
* Best for: Automated workloads, API servers, production deployments
* No automatic SSH/Jupyter setup

## Important Template Settings

### Docker Image

* Always specify a version tag (avoid "latest")
* Vast.ai base images (`vastai/pytorch`) start faster due to caching
* Custom images from Docker Hub supported

### On-start Script

* Runs after the container starts
* Use for installing additional packages
* Executes as bash commands

### Disk Space

* Set in the search interface (not the template)
* Cannot be changed after instance creation
* Default is 10GB - increase as needed

## Common Issues

### Template Compatibility

Not all templates work on all machines. If an instance fails to start:

* Try a recommended template
* Check Docker image availability
* Verify port requirements match machine capabilities

### Invalid Docker Image Path

If you get an error like "Unable to find image 'ubuntu20.04\_latest/ssh'":

* You have an invalid Docker image path
* Use proper format: `nvidia/cuda:12.0.1-devel-ubuntu20.04`
* Always include repository and tag
* Test locally: `docker pull <YOUR_IMAGE_PATH>`
* Use recommended templates to ensure valid paths

### Image Loading Time

* First launch can take 5-60 minutes depending on image size
* Vast.ai base images load faster (pre-cached on many machines)
* You're not charged during loading

### Can't Change Template on Existing Instance

Templates are recipes for new instances. Once an instance is created:

* Template changes only affect new instances
* To use a different template, create a new instance
* Transfer data if needed using [data movement tools](/guides/instances/storage/data-movement)

## Next Steps

**Ready to customize?**
See the full [Templates documentation](/guides/templates/introduction) for:

* [Creating custom templates](/guides/templates/creating-templates)
* [Advanced configuration](/guides/templates/advanced-setup)
* [Template settings reference](/guides/templates/template-settings)

**Having issues?**

* Start with a recommended template
* Check the [Templates FAQ](/guides/reference/faq/instances#templates)
* Review [troubleshooting guide](/guides/reference/troubleshooting)
