Host a website using a tailnet device
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 Tailscale Serve. Alternatively, you can use the instructions below to host a website that is accessible to the public Internet, using Tailscale Funnel.
Here are instructions for creating various cloud-based Linux VMs and setting up Tailscale on your VM:
After your Linux VM is created, you must also install Tailscale on your Linux VM.
Start by creating a file named
index.htmlon your local machine for testing. Here is an example of HTML code that you can use in your file:
<!DOCTYPE html> <html> <head> <title>Test Website</title> </head> <body> <h1>This is a heading</h1> <p>This is a paragraph</p> </body> </html>
/tmpdirectory and a subdirectory on your local machine below the root directory:
mkdir /tmp mkdir /tmp/test-funnel
index.htmlfile you created into the
/tmp/test-funnelsubdirectory that you created in the previous step. In this example, the current location of the file is
mv /home/amelie/index.html /tmp/test-funnel
Run the following command on your machine to serve the
index.htmlfile to your tailnet:
tailscale serve /tmp/test-funnel/index.html
Or, if you want to make the same files and website visible on the public Internet, use the following command:
tailscale funnel /tmp/test-funnel/index.html
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 Machines page of the admin console, and the tailnet name can be found in the DNS page of the admin console.
If your tailnet machine name is
amelie-vm, and your tailnet name is
pango-lin.ts.net, share the URL:
Want to see this working in action?