Access your tailnet from GitHub Codespaces

GitHub Codespaces is a way to run Visual Studio Code—with its editor, terminal, debugger, version control, settings sync, and the entire ecosystem of extensions—hosted in the cloud.

Tailscale can be installed within a Codespace to be able to access private resources such as package registries or license servers securely, regardless of whether they’re in the cloud or on premises. You can also use Tailscale to share your development or staging environment with a colleague.


If you’re already using Codespaces, the following files from the tailscale/codespace repository will need to be incorporated:

  1. .devcontainer/Dockerfile should be a layer in the build, or incorporated into the project Dockerfile
  2. .devcontainer/devcontainer.json has capabilities requested in runArgs and a postStartCommand which are needed for operation


To allow the Codespace Virtual Machine to join your tailnet, create a reusable auth key for your tailnet and add it as a Codespaces Secret named TAILSCALE_AUTHKEY. We recommend using a reusable auth key, rather than an ephemeral key, so that your environment always reconnects as the same Tailscale node.

GitHub Codespace writing this article

Last updated

WireGuard is a registered
trademark of Jason A. Donenfeld.

© 2022 Tailscale Inc.

Privacy & Terms