{"slug":"access-your-tailnet-github-codespaces","title":"Access your tailnet GitHub Codespaces","tags":["tailscale","access-control"],"agent_summary":"Last validated: Jan 5, 2026","trigger_phrases":[],"runnable":false,"markdown":"\r\n# Access your tailnet GitHub Codespaces\r\n\r\nLast validated: Jan 5, 2026\r\n\r\n[GitHub Codespaces](https://github.com/features/codespaces) is a way to run Visual Studio\r\nCode—with its editor, terminal, debugger, version control, settings sync,\r\nand the entire ecosystem of extensions—hosted in the cloud.\r\n\r\nTailscale can be installed within a Codespace to be able to access private resources\r\nsuch as package registries or license servers securely, regardless of whether they're in\r\nthe cloud or on premises. You can also use Tailscale to share your development or staging\r\nenvironment with a colleague.\r\n\r\n## [Integration](https://tailscale.com/docs/integrations/github/github-codespaces\\#integration)\r\n\r\nWhen using [GitHub Codespaces](https://github.com/features/codespaces), you can include Tailscale as a [feature](https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-features-to-a-devcontainer-file) in your [dev container](https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers).\r\n\r\nThis feature is available from the [`tailscale/codespace` repository](https://github.com/tailscale/codespace).\r\n\r\nTo use the Tailscale feature, in your `devcontainer.json` include:\r\n\r\n```json\r\n\"runArgs\": [\"--device=/dev/net/tun\"],\r\n\"features\": {\r\n  // ...\r\n  \"ghcr.io/tailscale/codespace/tailscale\": {}\r\n  // ...\r\n}\r\n```\r\n\r\nYou can use the [visual policy editor](https://tailscale.com/docs/features/visual-editor) to manage your tailnet policy file. Refer to the [visual editor reference](https://tailscale.com/docs/reference/visual-editor) for guidance on using the visual editor.\r\n\r\nThen launch your codespace.\r\n\r\n## [Authorization](https://tailscale.com/docs/integrations/github/github-codespaces\\#authorization)\r\n\r\nThe first time the codespace starts it is necessary to authenticate it to join the tailnet.\r\nIn the terminal window run: `tailscale set --accept-routes`\r\n\r\nThis will print a URL to visit in a browser where you can log into the desired account.\r\n\r\n![GitHub Codespace writing this topic](https://tailscale.com/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fcodespace.f2d3d8b5.jpg&w=3840&q=75)\r\n\r\n![Project Logo](https://cdn.brandfetch.io/tailscale.com/fallback/lettermark/theme/dark/h/256/w/256/icon?c=1bfwsmEH20zzEfSNTed)\r\n\r\nAsk AI\r\n\r\nreCAPTCHA\r\n\r\nRecaptcha requires verification.\r\n\r\nprotected by **reCAPTCHA**\r\n","html":"<h1>Access your tailnet GitHub Codespaces</h1>\n<p>Last validated: Jan 5, 2026</p>\n<p><a href=\"https://github.com/features/codespaces\">GitHub Codespaces</a> is a way to run Visual Studio\r\nCode—with its editor, terminal, debugger, version control, settings sync,\r\nand the entire ecosystem of extensions—hosted in the cloud.</p>\n<p>Tailscale can be installed within a Codespace to be able to access private resources\r\nsuch as package registries or license servers securely, regardless of whether they're in\r\nthe cloud or on premises. You can also use Tailscale to share your development or staging\r\nenvironment with a colleague.</p>\n<h2><a href=\"https://tailscale.com/docs/integrations/github/github-codespaces#integration\">Integration</a></h2>\n<p>When using <a href=\"https://github.com/features/codespaces\">GitHub Codespaces</a>, you can include Tailscale as a <a href=\"https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-features-to-a-devcontainer-file\">feature</a> in your <a href=\"https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers\">dev container</a>.</p>\n<p>This feature is available from the <a href=\"https://github.com/tailscale/codespace\"><code>tailscale/codespace</code> repository</a>.</p>\n<p>To use the Tailscale feature, in your <code>devcontainer.json</code> include:</p>\n<pre><code class=\"language-json\">\"runArgs\": [\"--device=/dev/net/tun\"],\r\n\"features\": {\r\n  // ...\r\n  \"ghcr.io/tailscale/codespace/tailscale\": {}\r\n  // ...\r\n}\n</code></pre>\n<p>You can use the <a href=\"https://tailscale.com/docs/features/visual-editor\">visual policy editor</a> to manage your tailnet policy file. Refer to the <a href=\"https://tailscale.com/docs/reference/visual-editor\">visual editor reference</a> for guidance on using the visual editor.</p>\n<p>Then launch your codespace.</p>\n<h2><a href=\"https://tailscale.com/docs/integrations/github/github-codespaces#authorization\">Authorization</a></h2>\n<p>The first time the codespace starts it is necessary to authenticate it to join the tailnet.\r\nIn the terminal window run: <code>tailscale set --accept-routes</code></p>\n<p>This will print a URL to visit in a browser where you can log into the desired account.</p>\n<p><img src=\"https://tailscale.com/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fcodespace.f2d3d8b5.jpg&#x26;w=3840&#x26;q=75\" alt=\"GitHub Codespace writing this topic\"></p>\n<p><img src=\"https://cdn.brandfetch.io/tailscale.com/fallback/lettermark/theme/dark/h/256/w/256/icon?c=1bfwsmEH20zzEfSNTed\" alt=\"Project Logo\"></p>\n<p>Ask AI</p>\n<p>reCAPTCHA</p>\n<p>Recaptcha requires verification.</p>\n<p>protected by <strong>reCAPTCHA</strong></p>\n"}