# Templates

A template is a prepared starting point for computers. You build it once from an image and a list of steps, and every computer you create from it starts with that setup, so agents do not install their tools each time.

## Build a template

A template starts from Ubuntu 24.04, or from another template, and runs its steps in order:

```ts
const build = await new TemplateBuilder("billing")
  .aptInstall(["git", "ripgrep"])
  .bunInstall(["tsx"])
  .uvInstall(["pandas"])
  .gitClone("https://github.com/acme/billing")
  .setWorkdir("/home/agent/billing")
  .build(computer);

const template = await build.wait();
```

| Step                      | What it does                                             |
| ------------------------- | -------------------------------------------------------- |
| `aptInstall`              | Installs system packages with apt.                       |
| `bunInstall`              | Installs JavaScript packages globally with Bun.          |
| `uvInstall`               | Installs Python packages with uv.                        |
| `gitClone`                | Clones a repository, at a branch or tag if you name one. |
| `run`                     | Runs a shell command.                                    |
| `copyFiles` / `writeFile` | Puts files into the template.                            |
| `setEnv`                  | Sets variables for later steps and for every computer.   |
| `setWorkdir` / `setUser`  | Sets where and as whom later steps run.                  |

`wait` follows the build until the template is ready or has failed, and `logs` streams the build as it runs.

## Create computers from it

Name the template as the source when you create a computer, with `Source::Template { name }`. Template names are unique in your organization, and any number of computers can start from one template.

A template does not change once it is built. To change the setup, build a new template, or build one on top of it with `fromTemplate`.

## Storage

A template can hold up to 120 GiB. A computer's storage counts the bytes it inherits from its template, and those inherited bytes cost 40% less than its own. See [Pricing](https://elios.ai/pricing).

## Next steps

* [Forks](/computer/concepts/forks): start a computer from another computer
* [Extensions](/computer/concepts/extensions): give agents your application as commands
