# Getting started

From a blank device to an SSH session in about two minutes. You need a device
that runs Linux and can reach the internet, and a RelaySSH account.

## Install the agent

Copy your install command from the dashboard (**Add device**)
and run it on the device. It downloads the agent, registers the device to
your account, and starts the connection.

```sh
curl -fsSL https://relayssh.com/install/YOUR-INSTALL-KEY/ | sudo sh
```

> **Note:** The install key ties the device to your account. Keep it private; you can rotate it any time in Settings.

> **Note:** Re-running the installer is also how you upgrade. If you run it over a relay tunnel, the agent restarts and your SSH session drops as the tunnel goes down — that is expected. The installer prints its summary before the restart, so reconnect and carry on.

## Watch the device come online

The device appears in your dashboard within a few seconds and reports a
heartbeat every 5 seconds. A green status dot means the agent is checking
in; the tunnel's own status shows on the device's page once you add one.

## Open a tunnel

On the device's detail page, add a tunnel to the port you want to reach —
port 22 for SSH. The relay assigns that tunnel its own public port
(20000–29999) and the agent opens a reverse tunnel to it. Add as many as
you like; each one gets its own port.

## SSH in

Connect to your assigned port on the relay. Replace the port and user with yours:

```sh
ssh -p 20001 pi@relayssh.com
```

The session lands on your device, and your device checks your key or password — not us:

```
$ ssh -p 20001 pi@relayssh.com
pi@bedroom-pi:~ $
```

> **Tip:** Add a Host entry to your ~/.ssh/config so connecting is just: ssh bedroom-pi

## Where next

A tunnel forwards any TCP port, not just SSH —
[host a website from your Pi](https://relayssh.com/docs/host-a-website/)
the same way. If your ISP gives you no public IP, the
[CGNAT guide](https://relayssh.com/docs/ssh-behind-cgnat/) explains
why none of that matters here. More guides are on the way: the security
model and troubleshooting. For now, the dashboard is your home base.
