# Connect to an instance

> Work on your instance from the browser, your own terminal or your IDE, without losing your session.

This page covers the three ways to open a shell on a running instance, and how to keep work running when you disconnect.

<table>
<thead>
  <tr>
    <th>
      Method
    </th>
    
    <th>
      Needs
    </th>
    
    <th>
      Best for
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      Browser terminal
    </td>
    
    <td>
      Nothing
    </td>
    
    <td>
      Quick access from any browser.
    </td>
  </tr>
  
  <tr>
    <td>
      SSH
    </td>
    
    <td>
      An SSH key and an image that can run an SSH server
    </td>
    
    <td>
      Your own terminal, IDE remote development, <code>
        scp
      </code>
      
       and <code>
        rsync
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      CLI
    </td>
    
    <td>
      The CLI, signed in
    </td>
    
    <td>
      Scripts, and a shell without an SSH key.
    </td>
  </tr>
</tbody>
</table>

## Open the browser terminal

The instance's **Terminal** tab opens a shell in a tmux session named `default`, so your work keeps running if you close the tab or lose your connection. The session menu opens or creates other named sessions.

The terminal closes after 30 minutes without activity. Processes in its tmux session keep running.

## Connect with SSH

<steps level="4">

#### Add an SSH key

Add your public key on the [Credentials page](https://console.cloud.featherless.ai/credentials/ssh-keys). See [SSH keys](/get-started/credentials#add-an-ssh-key).

#### Copy the SSH command

The instance's **Connect** tab shows the SSH command once SSH is ready:

```bash
ssh <instance-id>@ssh.cloud.featherless.ai
```

#### Connect

Run the command in your terminal. You log in as `root`.

</steps>

The CLI can build the command for you, using your SSH config and agent:

```bash
featherless-cloud instance ssh my-instance
featherless-cloud instance ssh my-instance -i ~/.ssh/work_ed25519
```

SSH works with official templates. For a custom image, it works when the image runs as root and includes an SSH server, or a package manager (`apt`, `dnf`, `yum`, `apk` or `zypper`) that can install one. The browser terminal works with any image.

## Keep programs running with tmux

Every instance has a tmux session named `default`, shared with the browser terminal. To attach to it from your computer:

```bash
featherless-cloud instance tmux my-instance
featherless-cloud instance tmux my-instance training
```

The second command attaches to, or creates, a session named `training`. Detach with **Ctrl-b d**.

To put every SSH login in the `default` session automatically, switch on **Auto start tmux in SSH sessions** when you deploy or edit the instance.

<note>

tmux sessions end when the instance stops or restarts.

</note>

## Open a shell from the CLI

`instance shell` opens the same shell as the browser terminal, without an SSH key:

```bash
featherless-cloud instance shell my-instance
```

## Next steps

<card-group>
<card icon="i-lucide-globe" title="Expose ports" to="/instances/ports">

Reach web apps and APIs over HTTPS.

</card>

<card icon="i-lucide-folder-up" title="Transfer files" to="/storage/transfer-files">

Move data in and out of network volumes.

</card>
</card-group>
