{"slug":"host-a-website-using-a-tailnet-device","title":"Host a website using a tailnet device","tags":["tailscale","devices"],"agent_summary":"Last validated: Jan 5, 2026","trigger_phrases":[],"runnable":false,"markdown":"\r\n# Host a website using a tailnet device\r\n\r\nLast validated: Jan 5, 2026\r\n\r\nThis topic provides details about serving a website from a Tailscale device that is only accessible to other users in a Tailscale network (known as a tailnet) using [Tailscale Serve](https://tailscale.com/docs/features/tailscale-serve). Alternatively, you can use the instructions below to host a website that is accessible to the public internet, using [Tailscale Funnel](https://tailscale.com/docs/features/tailscale-funnel).\r\n\r\n## [Prerequisites](https://tailscale.com/docs/features/tailscale-funnel/how-to/host-websites\\#prerequisites)\r\n\r\n- You need a [Tailscale account](https://tailscale.com/docs/how-to/quickstart).\r\n- You need to [install Tailscale on your local machine](https://tailscale.com/download).\r\n\r\nWe recommend serving your files and website using a Linux VM. You can attempt this on macOS. However, due to the sandboxed nature of the operating system, you may encounter errors.\r\n\r\nHere are instructions for creating various cloud-based Linux VMs and setting up Tailscale on your VM:\r\n\r\n- [Create a Linux VM on Azure](https://learn.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-portal?tabs=ubuntu)\r\n- [Create a Linux VM on AWS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html)\r\n- [Create a Linux VM on GCP](https://cloud.google.com/compute/docs/create-linux-vm-instance)\r\n\r\nAfter your Linux VM is created, you must also [install Tailscale on your Linux VM](https://tailscale.com/docs/install/linux).\r\n\r\n## [Serve your files and website](https://tailscale.com/docs/features/tailscale-funnel/how-to/host-websites\\#serve-your-files-and-website)\r\n\r\n1. Start by creating a file named `index.html` on your local machine for testing. Here is an example of HTML code that you can use in your file:\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n       <head>\r\n           <title>Test Website</title>\r\n       </head>\r\n       <body>\r\n           <h1>This is a heading</h1>\r\n           <p>This is a paragraph</p>\r\n       </body>\r\n</html>\r\n```\r\n\r\n2. Create a `/tmp` directory and a subdirectory on your local machine below the root directory:\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n```shell\r\nmkdir /tmp\r\nmkdir /tmp/test-funnel\r\n```\r\n\r\n3. Move the `index.html` file you created into the `/tmp/test-funnel` subdirectory that you created in the previous step. In this example, the current location of the file is `/home/amelie`:\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n```shell\r\nmv /home/amelie/index.html /tmp/test-funnel\r\n```\r\n\r\n4. Run the following command on your machine to serve the `index.html` file to your tailnet:\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n```shell\r\ntailscale serve /tmp/test-funnel/index.html\r\n```\r\n\r\n\r\n\r\nOr, if you want to make the same files and website visible on the public internet, use the following command:\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n```shell\r\ntailscale funnel /tmp/test-funnel/index.html\r\n```\r\n\r\n\r\n## [Share your website](https://tailscale.com/docs/features/tailscale-funnel/how-to/host-websites\\#share-your-website)\r\n\r\nYou can now share the website URL by combining your tailnet machine name and the name of your tailnet. The machine name can be found in the [Machines](https://login.tailscale.com/admin/machines) page of the admin console, and the tailnet DNS name can be found in the [DNS](https://login.tailscale.com/admin/dns) page of the admin console.\r\n\r\nIf your tailnet machine name is `amelie-vm`, and your tailnet DNS name is `pango-lin.ts.net`, share the URL:\r\n\r\n`https://amelie-vm.pango-lin.ts.net`\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>Host a website using a tailnet device</h1>\n<p>Last validated: Jan 5, 2026</p>\n<p>This topic provides details about serving a website from a Tailscale device that is only accessible to other users in a Tailscale network (known as a tailnet) using <a href=\"https://tailscale.com/docs/features/tailscale-serve\">Tailscale Serve</a>. Alternatively, you can use the instructions below to host a website that is accessible to the public internet, using <a href=\"https://tailscale.com/docs/features/tailscale-funnel\">Tailscale Funnel</a>.</p>\n<h2><a href=\"https://tailscale.com/docs/features/tailscale-funnel/how-to/host-websites#prerequisites\">Prerequisites</a></h2>\n<ul>\n<li>You need a <a href=\"https://tailscale.com/docs/how-to/quickstart\">Tailscale account</a>.</li>\n<li>You need to <a href=\"https://tailscale.com/download\">install Tailscale on your local machine</a>.</li>\n</ul>\n<p>We recommend serving your files and website using a Linux VM. You can attempt this on macOS. However, due to the sandboxed nature of the operating system, you may encounter errors.</p>\n<p>Here are instructions for creating various cloud-based Linux VMs and setting up Tailscale on your VM:</p>\n<ul>\n<li><a href=\"https://learn.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-portal?tabs=ubuntu\">Create a Linux VM on Azure</a></li>\n<li><a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html\">Create a Linux VM on AWS</a></li>\n<li><a href=\"https://cloud.google.com/compute/docs/create-linux-vm-instance\">Create a Linux VM on GCP</a></li>\n</ul>\n<p>After your Linux VM is created, you must also <a href=\"https://tailscale.com/docs/install/linux\">install Tailscale on your Linux VM</a>.</p>\n<h2><a href=\"https://tailscale.com/docs/features/tailscale-funnel/how-to/host-websites#serve-your-files-and-website\">Serve your files and website</a></h2>\n<ol>\n<li>Start by creating a file named <code>index.html</code> on your local machine for testing. Here is an example of HTML code that you can use in your file:</li>\n</ol>\n<pre><code class=\"language-html\">&#x3C;!DOCTYPE html>\r\n&#x3C;html>\r\n       &#x3C;head>\r\n           &#x3C;title>Test Website&#x3C;/title>\r\n       &#x3C;/head>\r\n       &#x3C;body>\r\n           &#x3C;h1>This is a heading&#x3C;/h1>\r\n           &#x3C;p>This is a paragraph&#x3C;/p>\r\n       &#x3C;/body>\r\n&#x3C;/html>\n</code></pre>\n<ol start=\"2\">\n<li>Create a <code>/tmp</code> directory and a subdirectory on your local machine below the root directory:</li>\n</ol>\n<pre><code class=\"language-shell\">mkdir /tmp\r\nmkdir /tmp/test-funnel\n</code></pre>\n<ol start=\"3\">\n<li>Move the <code>index.html</code> file you created into the <code>/tmp/test-funnel</code> subdirectory that you created in the previous step. In this example, the current location of the file is <code>/home/amelie</code>:</li>\n</ol>\n<pre><code class=\"language-shell\">mv /home/amelie/index.html /tmp/test-funnel\n</code></pre>\n<ol start=\"4\">\n<li>Run the following command on your machine to serve the <code>index.html</code> file to your tailnet:</li>\n</ol>\n<pre><code class=\"language-shell\">tailscale serve /tmp/test-funnel/index.html\n</code></pre>\n<p>Or, if you want to make the same files and website visible on the public internet, use the following command:</p>\n<pre><code class=\"language-shell\">tailscale funnel /tmp/test-funnel/index.html\n</code></pre>\n<h2><a href=\"https://tailscale.com/docs/features/tailscale-funnel/how-to/host-websites#share-your-website\">Share your website</a></h2>\n<p>You can now share the website URL by combining your tailnet machine name and the name of your tailnet. The machine name can be found in the <a href=\"https://login.tailscale.com/admin/machines\">Machines</a> page of the admin console, and the tailnet DNS name can be found in the <a href=\"https://login.tailscale.com/admin/dns\">DNS</a> page of the admin console.</p>\n<p>If your tailnet machine name is <code>amelie-vm</code>, and your tailnet DNS name is <code>pango-lin.ts.net</code>, share the URL:</p>\n<p><code>https://amelie-vm.pango-lin.ts.net</code></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"}