Skip to main content
The Blaxel Tailscale image includes Tailscale and connects to your tailnet when the sandbox starts. Provide a Tailscale authentication key to access the sandbox from any authorized device on your tailnet.

Prerequisites

Before starting, ensure you have:

1. Configure a Tailscale authentication key

Follow the Tailscale authentication key documentation to create a key. Then set it as an environment variable:
Treat TS_AUTHKEY as a secret. Do not commit it to source control or include it directly in application code.
The image uses userspace networking. You do not need to enable a TUN device or iptables. Use the TypeScript or Python SDK to call the Blaxel API. Create the sandbox with the blaxel/tailscale:latest image and pass TS_AUTHKEY as a runtime environment variable.
The sandbox stops immediately when TS_AUTHKEY is missing. An invalid, expired, or revoked key prevents Tailscale from connecting, so the sandbox stops when Tailscale exits or after the 60-second startup timeout.

3. Verify the Tailscale connection

Connect to the sandbox terminal:
Check that the sandbox is connected and retrieve its Tailscale IP address:
The image uses the first available hostname value in this order: TS_HOSTNAME, a manually provided SANDBOX_NAME, the Blaxel-provided BL_NAME, then tailscale-sandbox. In the standard Blaxel flow, the Tailscale hostname defaults to the sandbox name through BL_NAME. Set TS_HOSTNAME when creating the sandbox to use a different hostname.

4. Connect with Tailscale SSH

From another authorized device on your tailnet, connect with the sandbox hostname or Tailscale IP:
Your Tailscale SSH access policy determines which users and devices can connect.

Appendix: Configure Tailscale manually

Create a sandbox

This manual setup requires iptables, which is not enabled in sandboxes by default. You enable it by passing extraArgs at creation time.

Install and configure Tailscale in the sandbox

Connect to the sandbox terminal:
Next, install the tailscale and iptables packages and start the tailscaled daemon as a background process.
You can then run tailscale up --ssh to authenticate and enable Tailscale SSH.
Retrieve the Tailscale IP.

Connect to the sandbox using Tailscale

Once authenticated, the sandbox is reachable via SSH from any device on your Tailscale network:

Using the SDK

It’s also possible to create a sandbox and configure Tailscale using the Blaxel SDKs instead of the sandbox terminal:

Resources

Sandbox overview

Create and manage Blaxel sandboxes.

Tailscale authentication keys

Configure reusable and ephemeral authentication keys.
Last modified on August 12, 2026