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

# Connecting to Instances

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

export const QuickstartCard = ({title, icon, href, children, selected}) => {
  const enter = e => {
    if (selected) return;
    const el = e.currentTarget;
    el.style.borderColor = '#555';
    el.querySelector('[data-title]').style.color = '#fff';
    el.querySelector('[data-sub]').style.opacity = '0.7';
    el.querySelector('[data-icon]').style.opacity = '0.7';
  };
  const leave = e => {
    if (selected) return;
    const el = e.currentTarget;
    el.style.borderColor = '#333';
    el.querySelector('[data-title]').style.color = '';
    el.querySelector('[data-sub]').style.opacity = '0.5';
    el.querySelector('[data-icon]').style.opacity = '0.35';
  };
  return <a href={href} className="group" style={{
    textDecoration: 'none',
    borderBottom: 'none',
    color: 'inherit',
    display: 'block',
    marginBottom: '0.75rem'
  }}>
    <div className="border rounded-xl p-5 transition-all duration-150 border-zinc-200 dark:border-zinc-800" style={{
    minHeight: '8rem',
    height: '100%',
    borderWidth: '1.5px',
    borderColor: selected ? '#95c5ea' : '#333'
  }} onMouseEnter={enter} onMouseLeave={leave}>
      <div data-icon style={{
    marginBottom: '0.75rem',
    opacity: selected ? 1 : 0.35,
    transition: 'opacity 0.15s ease'
  }}>
        <Icon icon={icon} size={24} color="#95c5ea" />
      </div>
      <div data-title style={{
    fontWeight: 600,
    fontSize: '1.05rem',
    marginBottom: '0.25rem',
    color: selected ? '#fff' : undefined,
    transition: 'color 0.15s ease'
  }}>{title}</div>
      <div data-sub style={{
    fontSize: '0.9rem',
    opacity: selected ? 0.7 : 0.5,
    transition: 'opacity 0.15s ease'
  }}>{children}</div>
    </div>
  </a>;
};

<Columns cols={3}>
  <QuickstartCard title="VS Code" icon="window" href="/docs/vscode/operations/connecting-to-instances">
    Editor extension
  </QuickstartCard>

  <QuickstartCard title="CLI" icon="terminal" href="/docs/cli/operations/connecting-to-instances" selected={true}>
    Command line
  </QuickstartCard>

  <QuickstartCard title="Console" icon="browser" href="/docs/console/operations/connecting-to-instances">
    Web interface
  </QuickstartCard>
</Columns>

## 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:~$`.

<img src="https://mintcdn.com/thundercompute/BnD7RELom_XvTVi-/images/cli/connect-to-instance.png?fit=max&auto=format&n=BnD7RELom_XvTVi-&q=85&s=dccf1385ae31b2db8b3c9ed32a41baec" alt="Thunder CLI connected to a running GPU instance" width="2584" height="1180" data-path="images/cli/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.
</Note>

## Exposing Services

To expose web servers, Jupyter notebooks, or other services running on your instance, use a [Cloudflare Tunnel](/docs/technical-specs#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](/docs/console/operations/ssh).


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