Instance Setup
Templates
29min
vast ai provides linux docker instances a template is a saved set of initialization information that specifies what docker image to load along with options that can only be set when the instance is created the primary instance configuration menu is accessible by clicking on the templates link https //cloud vast ai/templates/ in the upper left navigation panel in the console recommended for typical use cases, we have recommended templates setup that will simply load a smart set of options for that use case simply click "select" to pick that template then you will be taken to the search interface to find a suitable gpu offer popular the most popular templates used on vast are in the popular section recent the last template section is where your customized and selected templates are saved anytime you select a template, it is then saved in the "recent" section referral link each template you create and make public can earn you referral credits with the referral program https //docs vast ai/referral program the referral link for each template is shown as a share icon on the template page or as a hash that you can copy in the search interface template menu the benefit of using the template referral link is that the user you refer will have the template you shared to them selected and saved to their account when clicked the primary instance configuration menu is accessible by clicking on the templates link https //cloud vast ai/templates/ in the upper left navigation panel in the console template customization to customize a template, click the edit button to bring up the template editor by editing any template, you make a new one there is no way to delete a recommended or popular template after you save your new template, it will appear in the recent section near the bottom alternatively, in the search interface you can also customize your template click on the change template button to bring up a select template pop up from either interface, the settings are the same for a complete explanation, see the section docker execution environment https //docs vast ai/instances/docker execution environment for details on exactly what options are supported specify a docker image enter the docker image from the docker pull command the interface will attempt to load the version tags from docker hub and provide them as selections as an example, to load the ubuntu image with the latest tag the command would be ubuntu\ latest docker repository (registry) authentication vast can connect to a custom docker repository and authenticate to that registry enter the registry information along with your username and password by scrolling down to the appropriate section docker create/run options vast supports port and environment variables from docker run options to expose a port, add the port command to the docker run options line p 5555 5555 adding that command to the run options would open port 5555 on the instance which will be mapped to an accessible external port on the machine to find the mapped port, open the ip\&port info link on the instance after it is running spaces mgwtdaam0bo2skpvyo6q uploads j4mlhw1z6j1ct0cpq5my open ports it is also possible to change environment variables for example e tz=utc sets the environment variable for time zone to utc so that the instance is now in the utc time zone see also docker execution environment https //docs vast ai/instances/docker execution environment select a launch mode vast provides a "launch mode" for the docker image which sets up ssh or jupyter for connecting to the instance instead of a normal entrypoint process after the instance starts, the gui provides the ssh command or jupyter link to connect to the instance also supported is a normal entrypoint process which allows you to configure a docker run command and pass arguments unless you know you intend to use a docker entrypoint, you probably want the ssh launch type with an onstart script direct vs proxy connections vast offers both proxy (default) and direct connection methods for ssh and jupyter launch modes in general, the proxy connections use a vast proxy server and work on machines without open ports the proxy connections are slower for data transfer the direct connections only work on machines with open ports when selected, the instance will open port 22 and/or 8080 when created these direct launch modes are the preferred methods to connect and allow direct connections to the instance data transfer is faster and the connection is more reliable also because the machine has open ports, it is possible to copy data off the instance when it is stopped to local or another instance using the vast cli copy command jupyter jupyter is an interactive notebook interface that is very popular for ai/ml development using python using jupyter, you can connect to an interface in your browser and open any notebook that you can download as a ipynb file we recommend this launch mode to start we also recommend this launch mode over trying to run google colab with vast while google colab has a way to connect to a "local runtime", running jupyter directly is more robust and less error prone if connections drop or the browser window is closed by default jupyter instances use a proxy server this is a simple setup that works on machines with or without open ports the only downside is it can be slower to upload/download large files jupyter direct https launch mode when selecting jupyter there is a check box for "jupyter direct https" when you select this box, you are then limiting your search to machines that have open ports, as you cannot run this option on machines without open ports so your machine search will narrow jupyter uses a browser interface, so to get the direct https connection to work, you will need to install a certificate onto your operating system ⚠️ warning if you don't install the browser certificate, windows and linux will show a "your connection is not private" privacy error it is annoying but you can click through by clicking "advanced" and then proceed if you don't install the certificate on macos, the os might not let you open the jupyter webpage installing the tls certificate start by downloading the certificate here https //console vast ai/static/jvastai root cer then follow the directions for your operating system in most operating systems, double clicking on the certificate will start an installation wizard you can also access the correct settings by clicking on the appropriate security settings in your browser chrome on windows open your chrome security settings by clicking on the three dot menu in the upper right then click settings then click privacy and security on the left hand navigation from that menu, select security click on "manage device certificates" click next and then click import and find the downloaded jvastai root cer https //console vast ai/static/jvastai root cer file click "place all certificates in the following store" and then use the browse button click on the trusted root certification authorities folder cert chrome windows 1 click finish and agree to finalize the import no reboot is necessary and all new instances created will then not have the warning pop up note that existing instances will still have the warning in most operating systems, double clicking on the certificate will start an installation wizard you can also access the correct settings by clicking on the appropriate security settings in your browser windows general click finish and agree to finalize the import no reboot is necessary and all new instances created will then not have the warning pop up note that existing instances will still have the warning windows general cert windows 1 click on the "install certificate" button select either the current user or local machine and hit next cert windows 2 click "place all certificates in the following store" click browse and select the folder "trusted root certification authorities" click ok then click next click "finish" to install the certificate cert windows 3 click on the "install certificate" button select either the current user or local machine and hit next cert windows 2 macos double click the certificate https //console vast ai/static/jvastai root cer after downloading it make sure that the keychain access application is opened and that there is an entry for vast ai jupyter in the list of certificates if it does not appear, then use the import button to manually import the certificate so that it appears in your list of certificates double click the certificate https //console vast ai/static/jvastai root cer after downloading it make sure that the keychain access application is opened and that there is an entry for vast ai jupyter in the list of certificates if it does not appear, then use the import button to manually import the certificate so that it appears in your list of certificates cert macos 1 change the "when using this certificate" box to "always trust" cert macos 2 cert macos 2 close the window the change should take effect immediately for all instances you have running and create in the future cert macos 2 close the window the change should take effect immediately for all instances you have running and create in the future ssh select this launch mode to connect to your instance using ssh once your instance is rented and starts, you will be given an ssh command that will have the right ports, hostname and settings to connect to your vast instance on ubuntu or mac, first you need to generate an rsa ssh public/private keypair using the command ssh keygen t rsa next you may need to force the daemon to load the new private key, and confirm it's loaded ssh add; ssh add l then get the contents of the public key with cat / ssh/id rsa pub copy the entire output to your clipboard, then paste that into the "change ssh key" text box under console/account the key text includes the opening "ssh rsa" part and the ending "user\@something" part if you don't copy the entire thing, it won't work example ssh key text ssh rsa aaaab3nzac1yc2eaaaadaqabaazbaqddxwwxwn5lz7ubkmrxm57chhvzonzult5fhi7j8zfxcjhfr96w+ccbobo2rtbbttrdlnjjisklgbcc3+jgyzhpunmfrvij7meqdehghfvuuv/ubkb7rjbyyfcb4bcsyngguzkmnnongea3aqtbszt47bnugqkszs9bfacapftr9wo0b8p4iyil/gfoy5kusvwkqrbcwrg53/+t2rak/02mwnhxybktjau1q9qtwcyo68jtdd0sa+4apsu+csjmbjs3fcddral3bcpikwrbckq+n63ol4xdv3zqrebuc98cjph04gnc41w02lmdqfl2xg5u/rv8/jm7cawkiiz3dbkv bob\@velocity you can use a few ssh keys by pasting in each on a new line into the account page the default ssh connection is made using a proxy this method is slower, as it involves a bounce server, but it works on machines without open ports for windows users, read our windows guide https //docs vast ai/windows ssh guide on how to use putty tools to ssh into a vast instance ssh direct this launch mode allows you to ssh directly into the instance the speed of the connection is then only limited by your local machine's connection and the connection speed displayed on the instance card the proxy ssh connection information is given as a backup, but it is typically slow on start scripts for both jupyter and ssh launch modes, you can paste in a script that will run bash commands after the machine starts add a semicolon ; at the end of each command entrypoint this allows you to configure a docker run command with a normal entrypoint process, instead of setting up ssh and remote access you will not be able to retrieve the command's output unless you know you intend to use a docker entrypoint, you probably want the ssh launch type with an onstart script select disk size when the instance is created, the disk size is set and cannot be modified it is important to estimate how much disk you will need and then to move the slider to the desired disk size the default disk size for an instance is 10gb use the slider to allocate more or less, taking into consideration that providers charge for disk allocation even when the instance is stopped each template you create and make public can earn you referral credits with the referral program https //docs vast ai/referral program the referral link for each template is shown as a share icon on the template page or as a hash that you can copy in the search interface template menu the benefit of using the template referral link is that the user you refer will have the template you shared to them selected and saved to their account when clicked ## common questions can i change my template on an existing instance? you can't change existing instances templates are recipes for new instances, so any changes to a template only effect new instances