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

# Deploy and Connect

> Deploy a GPU VM from the FlexAI Web Console and connect to it over SSH

Go from an empty Workspace to a shell on your own GPU VM in a few minutes.

You need:

* GPU VMs enabled for your Workspace (see [Getting access](https://docs.flex.ai/gpu-vms.md#getting-access)).
* An SSH key pair on your computer. To create one, run `ssh-keygen -t ed25519` and press Enter at each prompt.

## Deploy a VM

**1. Open GPU VMs**

In the [FlexAI Web Console](https://platform.flex.ai/managed/gpu-vms), go to **Managed Services → GPU VMs** and select **Deploy a GPU VM**.

**2. Choose the GPUs**

If your Workspace has more than one GPU option, pick one under **Choose a GPU**. Then set **GPU count**. The hint under the field shows the most GPUs one VM can have on that machine, and how many are free right now.

**3. Add your SSH public key**

Paste the contents of your public key file (for example `~/.ssh/id_ed25519.pub`) into **SSH public keys**. To give several people access, add one key per line, up to 10 keys.

```bash theme={null}
cat ~/.ssh/id_ed25519.pub
```

Supported key types are `ssh-ed25519`, `ssh-rsa`, `ecdsa-sha2-nistp256`, `ecdsa-sha2-nistp384` and `ecdsa-sha2-nistp521`. Hardware security keys (`sk-…` types) aren't supported yet.

**4. Name the VM**

Use lowercase letters, digits and hyphens, up to 63 characters, starting and ending with a letter or digit. Names are unique within a Workspace.

**5. Review and deploy**

The summary shows the GPU, the size of `/workspace`, and the estimated cost per hour while the VM runs. Select **Deploy**.

The VM shows **Provisioning** while it starts, then **Running**. Billing starts when it is ready for SSH.

> [!TIP]
>
> If no GPUs are free on that machine right now, try fewer GPUs or try again a little later.

## Connect over SSH

Open the VM and go to its **Connect** section. It shows a ready-made command for your VM, in this form:

```bash theme={null}
ssh -J gw@<gateway-host> root@<vm-address>
```

The connection goes through a FlexAI SSH gateway (`gw@…`) to your VM, where you sign in as `root`. Copy the command from the console rather than typing it, since the gateway and the address are specific to your VM.

### Use an SSH config entry

To connect with a short name, or from VS Code Remote-SSH, copy the SSH config snippet from the same section into `~/.ssh/config`. It looks like this, with your VM's name and addresses filled in:

```text ~/.ssh/config theme={null}
Host my-vm-gateway
  HostName <gateway-host>
  User gw

Host my-vm
  HostName <vm-address>
  User root
  ProxyJump my-vm-gateway
```

Then connect with:

```bash theme={null}
ssh my-vm
```

In VS Code, run **Remote-SSH: Connect to Host…** and pick `my-vm`.

## Use the browser terminal

Prefer not to set up SSH? Open the VM's **Console** tab for a terminal in your browser. Your console runs in your own tmux session, so a closed tab or dropped connection leaves your work running; reopen the tab to pick it back up. Each person can have up to 4 console tabs open on a VM at once.

## Check your GPUs

Once connected, confirm the GPUs are there:

```bash theme={null}
nvidia-smi
```

Keep the files you care about in `/workspace`. It's the disk that stays with your VM when you stop it. See [Manage your VMs](https://docs.flex.ai/gpu-vms/manage.md) for what happens to your data on stop and delete.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.