Prerequisites
Before starting, ensure you have:- a Blaxel account
- a Tailscale account
- a Tailscale authentication key
- the Blaxel CLI, logged in to your workspace
- the Blaxel TypeScript or Python SDK installed in your project
1. Configure a Tailscale authentication key
Follow the Tailscale authentication key documentation to create a key. Then set it as an environment variable:2. Create the sandbox through the API (recommended)
The image uses userspace networking. You do not need to enable a TUN device oriptables.
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.
3. Verify the Tailscale connection
Connect to the sandbox terminal: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:Appendix: Configure Tailscale manually
Create a sandbox
This manual setup requires iptables, which is not enabled in sandboxes by default. You enable it by passingextraArgs at creation time.
Install and configure Tailscale in the sandbox
Connect to the sandbox terminal:tailscale and iptables packages and start the tailscaled daemon as a background process.
tailscale up --ssh to authenticate and enable Tailscale SSH.
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.
