What is a Template?
A template is how Vast helps you launch an instance, setting up your rented machine with whatever software and formatting you need. Templates are generally used for launching instances through the web interface, but they can also be used in the CLI or through the API. In this document, we will focus on the web interface, but we will link to other relevant documentation thoughout. In the simplest technical terms, you can consider a template to be a wrapper arounddocker run
. The template contains all of the information you want to pass to our systems to configure the environment.
You can browse the template section of the web interface at cloud.vast.ai/templates
Recommended Templates
We provide several recommended templates to help you get started. These are pre-configured environments that you can use as-is, or you can tweak them to your own requirements.It’s a great idea to look at how these templates have been configured to guide you in creating your own.
Quick Start
To Jump right in and run a template, follow these steps Visit the templates section of the console where you will find all of our recommended templates.
Recommended Templates

NVIDIA CUDA Template

Offers page with GPU filter active

Instance view with blue open button
The action of the open button depends on the template you have chosen - In this example you will be transferred to the Instance Portal. Later in this guide we will discuss how this can be configured.
Creating Your Own Template
You can create a new template from scratch, or you can edit an existing template. For this gude we will edit the NVIDIA CUDA template we used in the Quick Start section. From the templates page, click the pencil icon on the template card to open up the template editor. You’ll see two tabsConfig
and ReadMe
. We’ll start with the config tab:
Identification
The first section helps you to keep your templates organized.
Identification section of the template editor
Docker Repository And Environment
This is where you define the Docker image you want to run, along with any options we want to pass into the container.
Docker section of the template editor
repository/image_name:tag
.
Many of our templates pull from DockerHub but you can use any container registry - Just remember to add the full path if you’re using an alternative registry. Eg. nvcr.io/nvidia/pytorch:25.04-py3
Version Tag
For many registries we are able to pull the available list of tags so this field allows you to quickly select another version.
There is also a special [Automatic]
tag you can use. With this selected, the machine you choose for your instance will pull the most recent docker image that is compatible with that machine’s own CUDA version.
This will only work if the image tag contains the CUDA version string. For example: my-image-cuda-12.8
would be loaded on a machine supporting CUDA 12.8, but a machine with only CUDA 12.6 would pull my-image-cuda-12.6
Docker Options
This field is a textual representation of the ports and environment variables declared in the sections beneath it. You can edit it directly or you can use the page widgets.
This field will only accept ports and environment variables. Other docker run options will be ignored.
Select Launch Mode
Templates offer three launch modes you can select from. Our recommened templates will usually launch in Jupyter mode for easiest access, but you are free to choose whichever suits your needs.
Launch mode selection options
8080
and SSH will be available on mapped port 22
.
Interactive shell server, SSH
As above, but SSH only with no Jupyter installation.
In both Jupyter and SSH mode, the docker entrypoint for your image will not be run. It will be replaced with our instance setup script so you should use the on start section (documented below) to start any services.

Field allowing for argument passing
On-start Script
Here you can enter a short Bash script which will be run during instance startup. It is only available when using the Jupyter or SSH launch modes, and is most useful for starting any services that your docker image would have launched if run if the entrypoint had been executed.
On-start Script
entrypoint.sh
script which contains the logic for preparing the instance.
Extra Filters
Use this area to place restrictions on the machines that should show up in the search page when the template is selected.
Extra filters showing this template is configured for both AMD64 and ARM64 CPUs
Docker Repository Authentication
If you are using a private Docker image then you will need to add authentication credentials so the machine running the instance can download it.
Docker Repository Authentication
Disk Space
By setting the disk space in the template, you can ensure that new instances created from the template with use this amount as a minimum.
Template Visibility
Any template marked as public will be available in the template search system, while private images will not. Private templates can still be used by others if you have shared the template URL.
Never save a template as public if it contains sensitive information or secrets. Use the account level environmnet variables as an alternative.
CLI Command
Templates can be translated directly into CLI launch commands. This read-only area shows what you would need to type or copy to the CLI if you wanted to programatically launch an instance this way.
Launch a template via the CLI
Save the Template
Finally, you can save the template. If you are creating a new template or editing one which is not associated with your account - Such as one of our recommended templates - The buttons you see will be labelled ‘Create’. For your own templates, you will see them labelled ‘Save’
Buttons for saving
Updating a Template
If you want to make changes to a template you previously saved, simply navigate back to the templates page and select ‘My Templates’. Here you’ll be able to make your changes by clicking the pencil icon.
My templates showing the NVIDIA CUDA - Demo template
Sharing a Template
It’s really easy to share your template with other users. We have two special links you can use and both include your referral code so you can earn if new users sign up - Find more about that here. To share, click the three dots icon in the bottom right of the template card.
Menu shows sharing options
Copy referral link
This will copy a link that contains your referral ID, creator ID and the template name. It will always point to the most recent template you created with this name - Really useful if you want people clicking the link to always get the most recent version.Copy template link
This will copy a link containing your referral ID and the template hash ID. It points to this specific template at this point in time. Templates all have a unique hash after every save. This is useful as it allows you to find a previous version if you have tracked the hash ID, but for sharing you probably want the referral link above.Remember to add a comprehensive Readme to your template if you’re going to share it. This will help users to get started easily.
Vast Templates
Templates that we have created will often be found in the Recommended section as they go through a QA process to ensure they function correctly and provide a positive user experience. They contain extras not found in all templates so we will address the differences here.Instance Portal
You will notice that after clicking the Open button on template running one of the Vast.ai templates a screen like this will appear.
Instance portal landing page
Provisioning Script
Vast.ai templates support running a remote script on start to help configure the instance and download models and extensions that may not already be available in the Docker image. To use this feature, simply add environment variablePROVISIONING_SCRIPT
and set the value to a plain text shell script URL. The file will be downloaded and run on first start of the instance.
Use the Provisioning Script to add a twist to an existing recommended template by downloading custom models and extensions.
Base Image
You can find the source code for the Docker images we used to create the Vast templates onGitHub
.
These are large Docker images that contain CUDA development libraries, node + npm, OpenCL and other useful libraries. Despite their large size you’ll find they generally start quickly because they have been cached on many of the host machines. This makes them ideal for using as a base for your own images.
Virtual Machine Templates
Currently we offer two VM templates; A CLI and a desktop GUI. These differ from a standard template because they launch a full virtual machine environment rather than a docker container. You can edit these templates as described above, but you should not change the docker image field. Only the images we distribue fromdocker.io/vastai/kvm
will work, but feel free to add extra environment variables and ports.
Use the VM templates when you need to:
- Run applications that require namespace support
- Run more than one Docker container in an instance
- Load kernel modules or run profiling jobs
- Mount remote drives with rclone or similar