# Connecting to Instances

> Connect to Thunder instances using the CLI. Establish secure remote connections and manage terminal sessions for cloud GPU development.

VS Code

Editor extension

[Open](https://www.thundercompute.one/docs/vscode/operations/connecting-to-instances.md)

CLI

Command line

[Open](https://www.thundercompute.one/docs/cli/operations/connecting-to-instances.md)

Console

Web interface

[Open](https://www.thundercompute.one/docs/console/operations/connecting-to-instances.md)

## Before You Connect

Make sure you have:

* Signed in with `tnr login`
* Created an instance
* Waited for the instance status to show `RUNNING`

Check your instances from the terminal:

```bash theme={null}
tnr status --no-wait
```

Use the `ID` column from that table when you connect. For your first running instance, the ID is usually `0`.

## Connect to an Instance

### Direct Connection

If you know the instance ID, pass it to `tnr connect`:

```bash theme={null}
tnr connect 0
```

Replace `0` with the ID from `tnr status`.

The CLI will set up SSH access, open the connection, and drop you into a shell on the instance. When the connection is ready, you will see a prompt like `ubuntu@thunder-client:~$`.

![Thunder CLI connected to a running GPU instance](https://www.thundercompute.one/assets/media/ac4d8ad08b-connect-to-instance.png)

### Interactive Connection

If you are not sure which instance to use, run:

```bash theme={null}
tnr connect
```

Select the running instance from the menu.

## End the Session

When you are done, type `exit` in the remote shell to close the SSH session.

> [!NOTE]
>
> If no instance appears, run `tnr status --no-wait` and confirm the instance is `RUNNING`. If you are signed out, run `tnr login` and try again.

## Exposing Services

To expose web servers, Jupyter notebooks, or other services running on your instance, use a [Cloudflare Tunnel](https://www.thundercompute.one/docs/technical-specs.md#port-access).

## Using Standard SSH

If you prefer using your own SSH client, Thunder is compatible with standard SSH tools. The CLI configures your `~/.ssh/config` automatically when you first connect.

Need to attach your own keys or copy an IP for manual access? Use the [console SSH workflow](https://www.thundercompute.one/docs/console/operations/ssh.md).
