# Build a Remote Exit Node with Tailscale and Fly.io: Setup Instructions

**URL:** <https://forum.hhf.technology/t/build-a-remote-exit-node-with-tailscale-and-fly-io-setup-instructions/381>\
**Category:** Networking\
**Tags:** fly-io, remote-exit-node, tailscale\
**Created:** [November 9, 2024, 7:50am UTC](https://forum.hhf.technology/t/build-a-remote-exit-node-with-tailscale-and-fly-io-setup-instructions/381 "2024-11-09T07:50:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [November 9, 2024, 7:50am UTC](https://forum.hhf.technology/t/build-a-remote-exit-node-with-tailscale-and-fly-io-setup-instructions/381/1 "2024-11-09T07:50:24Z")

</div>

# How to setup Tailscale exit note on [fly.io](http://fly.io)

[**fly.toml**]

```toml
app = "fly-scale"

[env]
  PATH="/usr/local/bin"
  TS_EXTRA_ARGS="--hostname=fly --advertise-exit-node"

[build]
  image = "tailscale/tailscale:stable"

[deploy]
  strategy="immediate"

[mounts]
  source="ts_data"
  destination="/var"

```

- Open [https://fly.io](https://fly.io) and register
- Open [Tailscale](https://login.tailscale.com/admin/settings/keys) to `Generate auth key`, pick `Reusable`+`Ephemeral`

### Install and authenticate your `flyctl`

```sh
$ brew install flyctl
$ flyctl auth login

```

### Create a [fly.io](http://fly.io) app from the provided `fly.toml` file

```sh
$ flyctl launch --copy-config

```

### Set the TS\_AUTH\_KEY env var for the current app.

```sh
$ flyctl secrets set TS_AUTH_KEY=tskey-xxxxx

```

### Create a volume to persist tailscale db.

```sh
$ fly volumes create ts_data --region fra --size 1

```

### Re-deploy, if you change some settings

```sh
$ flyctl deploy

```
