> For the complete documentation index, see [llms.txt](https://docs.instruqt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.instruqt.com/sandboxes/hosts/add-hosts.md).

# Add hosts

## Overview

Sandboxes support VMs and containers natively. Use the following points to determine if you should use one or the other.

You should use VMs if...

* You need control how many CPUs the host gets
* The host needs to be externally accessible ([see networking documentation](/reference/platform/networking.md))

You should use containers if...

* You want to make loading times as short as possible (they are generally faster to deploy)
* You have a lightweight application with minimal resource requirements

## Add VMs to sandboxes

You can use the web UI or Instruqt CLI to add VMs to a sandbox.

{% tabs %}
{% tab title="🌐 Web UI" %}

1. Select a track.
2. In the *Sandbox* section, click **Edit**.
3. In the *Your hosts* section, click **+ Add a host**.
4. Select **Virtual machine**.
5. Enter a hostname.
6. Select **Preset image** or **Choose your own**.
   * If you select **Preset image**, select the preset you wish to use.
   * If you select **Choose your own**, provide a GCP image and machine type ([see docs](/sandboxes/hosts/create-a-custom-vm-image.md)).
7. Define any additional settings you need.
   * Shell
   * External ingress
   * SSL certificate
   * Nested virtualization
8. Click **Save host**.
   {% endtab %}

{% tab title="💻 Instruqt CLI" %}
Within a track's `config.yml` file, VM hosts are defined like so:

```markdown
virtualmachines:
- name: <hostname>
  image: <gcp_project>/<image_name>
  machine_type: <machine_size>
```

{% endtab %}
{% endtabs %}

## Add containers to sandboxes

You can use the web UI or Instruqt CLI to add containers to a sandbox.

{% tabs %}
{% tab title="🌐 Web UI" %}

1. Select a track.
2. In the *Sandbox* section, click **Edit**.
3. In the *Your hosts* section, click **+ Add a host**.
4. Select **Container**.
5. Enter a hostname.
6. Select **Preset image** or **Choose your own**.
   * If you select **Preset image**, select the preset you wish to use.
   * If you select **Choose your own**, provide a custom image ([see docs](/sandboxes/hosts/custom-container-images.md)).
7. Define any additional settings you need.
   * Entrypoint
   * Cmd
   * Ports
   * Shell
8. Click **Save host**.
   {% endtab %}

{% tab title="💻 Instruqt CLI" %}
Within a track's `config.yml` file, container hosts are defined like so:

```markdown
containers:
- name: <hostname>
  image: <container_image>
  memory: <memory_ammount_mb>
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Each sandbox is subject to a limit of **15 containers and website services combined** at any given time. This limitation helps ensure optimal performance and resource allocation for all users.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.instruqt.com/sandboxes/hosts/add-hosts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
