# Reach Your xCloud Server Over Tailscale (and Close Port 22 Safely)

> Install Tailscale on your xCloud server, SSH in over your tailnet, then use SSH Lockdown to close port 22 to the internet while xCloud stays connected.

You can SSH into your xCloud server over [Tailscale](https://tailscale.com/) and close port 22 to the public internet, as long as **xCloud's own IP addresses stay allowed on your SSH port**. xCloud manages your server over SSH on its public IP, not through your tailnet (the private network of devices in your Tailscale account). So the safe setup is: Tailscale for you and your team, an allow rule for xCloud, and nothing else on port 22.

This guide installs Tailscale on the server, joins it to your tailnet so you sign in with your normal SSH keys over Tailscale, adds a firewall rule for your tailnet and then uses **SSH Lockdown** to remove the open SSH rule. For the reasons behind each rule, see [Lock down your server without breaking xCloud](/docs/lock-down-your-server-without-breaking-xcloud/). For what Tailscale is and how its pricing works, read [What is Tailscale?](/what-is-tailscale/).

## Before you start

- An xCloud server that shows **Connected**.
- A [sudo user](/docs/usudo-users-and-site-users-in-xcloud/) on the server and a way to sign in as it today, for example with [SSH keys](/docs/how-to-generate-and-add-ssh-keys-in-xcloud/).
- A Tailscale account, and Tailscale installed and signed in on the laptop you will connect from.
- Your provider's web console within reach, in case you lock yourself out.

## Step 1: Install Tailscale on the server

Sign in to the server as your sudo user over normal SSH, then run Tailscale's install script:

```bash
curl -fsSL https://tailscale.com/install.sh | sh
```

The script adds Tailscale's package repository and installs the `tailscaled` service. Check that it is installed:

```bash
tailscale version
```

Tailscale updates come from its own repository, not from Ubuntu's, so turn on its automatic updates:

```bash
sudo tailscale set --auto-update
```

[What is Tailscale?](/what-is-tailscale/) explains why this matters.

## Step 2: Join the server to your tailnet

Run:

```bash
sudo tailscale up
```

The command prints a login link. Open it in your browser and approve the server. It now shows up in your Tailscale admin console under **Machines**. Find its Tailscale address:

```bash
tailscale ip -4
```

The address starts with `100.`. Every device in your tailnet gets one from the `100.64.0.0/10` range.

You keep signing in with your normal SSH server and your SSH keys. Tailscale only carries the connection.

> **Optional: Tailscale SSH (`--ssh`).** `sudo tailscale up --ssh` turns on Tailscale SSH, which signs you in with your Tailscale identity instead of SSH keys. In October 2026 a researcher's report ("Tailworm") described flaws in Tailscale SSH, so this guide does not use it. Check [Tailscale's security bulletins](https://tailscale.com/security-bulletins) before you turn it on. Our [What is Tailscale?](/what-is-tailscale/) post explains the report. If you turn it on later, set who may sign in in the `ssh` section of your tailnet's access policy and keep it narrow, as Tailscale's [Tailscale SSH guide](https://tailscale.com/kb/1193/tailscale-ssh) explains. Every other step on this page stays the same.

## Step 3: Connect from your laptop over the tailnet

From your laptop, connect to the server's Tailscale address or its machine name:

```bash
ssh YOUR_SUDO_USER@100.x.y.z
```

Use the address from Step 2 in place of `100.x.y.z`. With MagicDNS on, the machine name from the admin console works too, for example `ssh YOUR_SUDO_USER@my-server`.

This is the same SSH sign-in you use today, with the same user and key. Only the address is different. The firewall still has its open SSH rule at this point, so the connection is allowed. Make sure you get a shell on the server. **Do not go on until this works.** The next steps remove public SSH access, and Tailscale is then your way in.

## Step 4: Allow SSH from your tailnet in Firewall Management

Open your server in xCloud and go to **Security → Firewall Management**. You'll see **SSH**, **HTTP** and **HTTPS** open to every IP address, and on most servers an **xCloud Infrastructure** rule that allows xCloud's IP addresses on your SSH port. Click **Add New Rule**.

![Click 'Add New Rule' in Server → Security → Firewall Management](/_landing/docs/use-tailscale-ssh-with-xcloud-server-image-1.png)

Fill in the **Add new firewall rule** form:

- **Name:** `Tailscale`
- **Port:** `22` (or your SSH port if you [changed it](/docs/how-to-update-ssh-port-in-xcloud/))
- **IP Address (Optional):** `100.64.0.0/10`
- **Protocol:** **TCP**
- **Traffic:** **Allow**

![The 'Add new firewall rule' form with Name 'Tailscale', Port 22 and IP Address 100.64.0.0/10 entered](/_landing/docs/use-tailscale-ssh-with-xcloud-server-image-2.png)

Click **Add Rule**. The new **Tailscale** rule appears in the list with **100.64.0.0/10** in the **IP Address** column.

![The new 'Tailscale' rule for port 22 from 100.64.0.0/10 in the Firewall Management list](/_landing/docs/use-tailscale-ssh-with-xcloud-server-image-3.png)

This rule lets SSH from your tailnet through the server's firewall. Normal SSH over Tailscale needs it once the open SSH rule is gone.

## Step 5: Turn on SSH Lockdown so only xCloud and your tailnet remain

In the same list, click the delete icon on the **SSH** rule (port 22, IP address `-`, meaning every IP). The **Firewall Rule Deletion Warning** opens.

If the warning shows **Yes, add xCloud infrastructure IPs before deletion**, tick it. The box turns green and reads **xCloud Infrastructure Will Be Added**, with the list of xCloud addresses it will allow on your SSH port. If it doesn't, check first that the **xCloud Infrastructure** rule is in the list. That rule already lets xCloud in.

![When shown, tick 'Yes, add xCloud infrastructure IPs before deletion' in the Firewall Rule Deletion Warning](/_landing/docs/use-tailscale-ssh-with-xcloud-server-image-4.png)

Leave **Yes, add my IP before deletion** unticked if you want no public SSH at all. Tick it only if you want your current public IP as a backup way in.

Tick the two confirmations, **I understand this affects SSH access and have console access available** and **I accept full responsibility for this action**, then click **I Understand, Delete Rule Anyway**. xCloud adds any missing xCloud IP addresses to the **xCloud Infrastructure** rule first, then removes the open SSH rule.

Port 22 now accepts connections only from xCloud's IP addresses and your tailnet. Ports 80 and 443 stay open, so your sites keep serving visitors. The full SSH Lockdown walkthrough is in [How to configure SSH Lockdown](/docs/how-to-configure-ssh-lockdown/).

## Step 6: Check that everything still connects

1. On the server page, click **Check Again** next to **Checked:**. The stats refresh and the server stays **Connected**.
2. From your laptop, connect over the tailnet again as in Step 3. Your **Tailscale** rule allows it, so you get the same shell as before.
3. From a network outside your tailnet, try `ssh YOUR_SUDO_USER@SERVER_IP`. No rule allows that address on your SSH port any more, so the firewall blocks it. If it still connects, check that the open **SSH** rule is gone from Firewall Management.

If you use a firewall at your provider as well (Hetzner, Vultr, DigitalOcean, AWS and others), it must also allow your SSH port from every address in [app.xcloud.host/ips](https://app.xcloud.host/ips).

## What not to do

Each of these leaves the server **Disconnected**, because xCloud can no longer reach SSH on the public IP:

| Don't | Why it breaks |
|---|---|
| Delete the **SSH** rule when the warning offers **Yes, add xCloud infrastructure IPs before deletion** and you leave it unticked, or when there is no **xCloud Infrastructure** rule | Nothing allows xCloud on port 22 any more. |
| Close port 22 by hand with `ufw` instead of Firewall Management | xCloud's allow rule is never added, and Firewall Management no longer matches what is on the server. |
| Make `sshd` listen only on the Tailscale address | xCloud connects to the public IP, where nothing answers. |
| Set `PermitRootLogin no` or remove xCloud's key from `/root/.ssh/authorized_keys` | xCloud signs in as root with its own key. |

If it happens anyway, follow [If your server shows Disconnected](/docs/lock-down-your-server-without-breaking-xcloud/#if-your-server-shows-disconnected) or [Server disconnected: are my sites down, and what can I fix myself](/docs/server-gets-disconnected/). If Tailscale stops working, go to **Security → Firewall Management** in xCloud and click **Add New Rule** to allow SSH from your own IP. If xCloud also shows **Disconnected**, use your provider's web console.

## Frequently asked questions

### Will Tailscale stop xCloud from managing my server?

No. xCloud connects to your server's public IP over normal SSH, not through your tailnet. As long as xCloud's IP addresses stay allowed on your SSH port, the server stays Connected.

### Can I close port 22 completely once Tailscale works?

No. Close it to the public internet, not to everyone. Use SSH Lockdown. If the warning shows 'Yes, add xCloud infrastructure IPs before deletion', tick it; if it doesn't, check that the xCloud Infrastructure rule is in the list. That rule keeps xCloud allowed. Closing port 22 to every address leaves the server Disconnected.

### Do I need to open a port for Tailscale in Firewall Management?

No. Tailscale makes outbound connections to join your tailnet, so it needs no new inbound port. You only add the rule that allows SSH from 100.64.0.0/10, the Tailscale address range.

### Should I use Tailscale SSH or normal SSH over Tailscale?

Use normal SSH over Tailscale. It keeps your SSH keys and skips the Tailscale SSH feature. In October 2026 a researcher's report ("Tailworm") described flaws in Tailscale SSH, so this guide leaves Tailscale SSH off. Check [Tailscale's security bulletins](https://tailscale.com/security-bulletins) before you turn it on.

If you run into any issues while setting up Tailscale, feel free to reach out to our [support team](/docs/access-built-in-support-portal-in-xcloud/).
