🔗 Tailscale: your own private network · Tailscale: เครือข่ายส่วนตัวของคุณเอง · Tailscale:你自己的私人网络

Reach your computers from anywhere, as if they sit on one desk. Learn what it is. Then install it and set it up. · เข้าถึงคอมพิวเตอร์ของคุณจากที่ไหนก็ได้ เหมือนวางอยู่บนโต๊ะเดียวกัน มันคืออะไร ติดตั้งอย่างไร และตั้งค่าอย่างไร · 在任何地方连上你的电脑,就像它们放在同一张桌子上。它是什么、怎么安装、怎么设置。

🇬🇧 English

You have a computer at home. Maybe it runs an AI model. You are at a café, or at school. You want to use that computer now.

Normally this is hard. Your home router blocks the outside world, and that is good. Opening a hole in it is risky.

Tailscale solves this without opening any holes. You install a small app on each device and log in. Now your devices can talk to each other, from any network. Nobody else can join.

🇹🇭 ไทย

คุณมีคอมพิวเตอร์อยู่ที่บ้าน อาจรันโมเดล AI อยู่ แต่ตอนนี้คุณอยู่ที่ร้านกาแฟหรือที่โรงเรียน และอยากใช้คอมพิวเตอร์เครื่องนั้นเดี๋ยวนี้

ปกติเรื่องนี้ยาก เราเตอร์ที่บ้านกันโลกภายนอกไว้ ซึ่งเป็นเรื่องดี การเจาะช่องให้มันมีความเสี่ยง

Tailscale แก้ปัญหานี้โดยไม่ต้องเจาะช่องเลย คุณติดตั้งแอปเล็ก ๆ ในทุกเครื่องแล้วล็อกอิน จากนั้นอุปกรณ์ของคุณคุยกันได้จากทุกเครือข่าย และคนอื่นเข้าร่วมไม่ได้

🇨🇳 中文

你家里有一台电脑,也许在跑一个 AI 模型。你现在在咖啡馆或学校,想马上用那台电脑。

平时这很难。家里的路由器挡住了外面的世界,这是好事;在上面开个口子是有风险的。

Tailscale 不用开任何口子就解决了这个问题。在每台设备上装一个小应用并登录,你的设备就能从任何网络互相通信,别人加不进来。

How Tailscale connects devices Three devices: a laptop at a café, a phone, and a computer at home. Each talks to the coordination server only to find the others. The data goes directly between devices through encrypted WireGuard tunnels. If a direct path is blocked, a DERP relay carries the encrypted data. Coordination server keys + addresses only · no data 💻 laptop · café 100.95.62.45 📱 phone 100.101.7.12 🖥️ spark · home 100.105.80.100 direct, encrypted WireGuard tunnel DERP relay: only if direct is blocked

Orange dashed lines: each device asks the server where the others are. Solid line: your data goes straight between devices. It is encrypted. The laptop and spark addresses are real ones from our own tailnet. The phone's is an example. เส้นประสีส้ม: อุปกรณ์แต่ละเครื่องถามเซิร์ฟเวอร์ประสานงานว่าจะหาเครื่องอื่นได้อย่างไร เส้นทึบ: ข้อมูลของคุณวิ่งตรงจากเครื่องถึงเครื่องแบบเข้ารหัส ที่อยู่ของแล็ปท็อปและ spark เป็นของจริงจาก tailnet ของเรา ส่วนของโทรศัพท์เป็นตัวอย่าง 橙色虚线:每台设备向协调服务器询问怎样找到其他设备。实线:你的数据加密后直接从设备传到设备。笔记本和 spark 的地址来自我们自己的 tailnet,手机的地址是示例。

1 🧠 What Tailscale is · Tailscale คืออะไร · Tailscale 是什么

🇬🇧 English

Tailscale is a VPN, a private network over the internet. It is built on WireGuard. WireGuard is a fast, modern way to encrypt traffic.

An old VPN sends everything through one central server. Tailscale does not. A central server only helps your devices find each other. Then the devices connect directly. This is called a mesh.

Sometimes a direct path is not possible. A strict school network can block it. Then a DERP relay passes the traffic along. The relay cannot read it. It is still encrypted.

🇹🇭 ไทย

Tailscale คือ VPN หรือเครือข่ายส่วนตัวที่วิ่งบนอินเทอร์เน็ต สร้างบน WireGuard ซึ่งเป็นวิธีเข้ารหัสการรับส่งข้อมูลที่เร็วและทันสมัย

VPN แบบเก่าส่งทุกอย่างผ่านเซิร์ฟเวอร์กลางเครื่องเดียว Tailscale ไม่ทำแบบนั้น เซิร์ฟเวอร์กลางแค่ช่วยให้อุปกรณ์หากันเจอ แล้วอุปกรณ์ก็เชื่อมต่อกันโดยตรง เรียกว่า mesh

บางครั้งเชื่อมตรงไม่ได้ เช่นในเครือข่ายโรงเรียนที่เข้มงวด ตอนนั้น DERP relay จะช่วยส่งต่อข้อมูล แต่ relay อ่านข้อมูลไม่ได้ เพราะยังเข้ารหัสอยู่

🇨🇳 中文

Tailscale 是一种 VPN,也就是架在互联网上的私人网络。它基于 WireGuard,一种快速、现代的网络加密方式。

老式 VPN 让所有流量都经过一台中央服务器,Tailscale 不这样。中央服务器只帮设备互相找到对方,然后设备之间直接连接。这叫 mesh(网状网络)

有时没法直连,比如在管得很严的学校网络里。这时由 DERP 中继转发流量。中继读不了内容,因为数据仍然是加密的。

Words you will see · คำที่จะได้เจอ · 你会见到的词

WordMeaning · ความหมาย · 意思
tailnetYour private network: all the devices on your account.เครือข่ายส่วนตัวของคุณ คืออุปกรณ์ทั้งหมดในบัญชีของคุณ你的私人网络:你账号里的所有设备。
node / machineOne device in the tailnet. It can be a laptop, phone, server or container.อุปกรณ์หนึ่งเครื่องใน tailnet เช่น แล็ปท็อป โทรศัพท์ เซิร์ฟเวอร์ หรือคอนเทนเนอร์tailnet 里的一台设备:笔记本、手机、服务器或容器。
Tailscale IPEach node gets a fixed address. It starts with 100. and stays the same on any network.ทุกเครื่องได้ที่อยู่ถาวรที่ขึ้นต้นด้วย 100. ย้ายเครือข่ายแล้วก็ไม่เปลี่ยน每个节点有一个以 100. 开头的固定地址,换网络也不变。
MagicDNSUse a name like spark instead of a number.ใช้ชื่ออย่าง spark แทนตัวเลขspark 这样的名字代替数字。
coordination serverTailscale's server. It shares public keys and addresses. It never sees your data.เซิร์ฟเวอร์ของ Tailscale ใช้แจกกุญแจสาธารณะและที่อยู่ ไม่เคยเห็นข้อมูลของคุณTailscale 的服务器,只分发公钥和地址,看不到你的数据。
DERP relayA backup path when devices cannot connect directly. The data stays encrypted.เส้นทางสำรองเมื่ออุปกรณ์เชื่อมตรงไม่ได้ ข้อมูลยังเข้ารหัสอยู่设备无法直连时的备用通道,数据仍然加密。
Serve / FunnelShare a web app. Serve: only your tailnet. Funnel: the whole internet.แชร์เว็บแอป Serve: เฉพาะใน tailnet ของคุณ Funnel: ทั้งอินเทอร์เน็ต分享网页应用。Serve:只在你的 tailnet 内;Funnel:整个互联网。

What it costs · ราคา · 费用

PlanPrice and limits (from tailscale.com/pricing, 15 September 2026) · ราคาและข้อจำกัด · 价格与限制
PersonalFree. Up to 6 users. Unlimited user devices. Up to 50 tagged devices, such as servers.ฟรี ผู้ใช้ไม่เกิน 6 คน อุปกรณ์ของผู้ใช้ไม่จำกัด อุปกรณ์ที่ติดแท็ก เช่นเซิร์ฟเวอร์ ไม่เกิน 50 เครื่อง免费。最多 6 个用户,用户设备不限,打了标签的设备(比如服务器)最多 50 台。
Standard$8 per user per month. For teams and businesses.8 ดอลลาร์ต่อผู้ใช้ต่อเดือน สำหรับทีมและธุรกิจ每用户每月 8 美元,面向团队和企业。
Premium · Enterprise$18 per user per month, or a custom price.18 ดอลลาร์ต่อผู้ใช้ต่อเดือน หรือราคาตามตกลง每用户每月 18 美元,或定制价格。
CAREFUL · WHAT TAILSCALE CAN SEE Your data is encrypted on your device. Tailscale cannot read it. But Tailscale does see metadata. It sees which devices connect to which. It sees their public IP addresses. You log in with Google, Microsoft or GitHub. So protect that account with two-step login. Whoever controls it controls your tailnet. ข้อมูลของคุณเข้ารหัสบนเครื่องของคุณ Tailscale อ่านไม่ได้ แต่ Tailscale เห็น เมทาดาทา คือเครื่องไหนเชื่อมกับเครื่องไหน และที่อยู่ IP สาธารณะของเครื่องเหล่านั้น คุณล็อกอินด้วย Google Microsoft หรือ GitHub จึงต้องป้องกันบัญชีนั้นด้วยการยืนยันสองขั้นตอน ใครคุมบัญชีนั้นได้ก็คุม tailnet ของคุณได้ 你的数据在你的设备上就加密了,Tailscale 读不到。但 Tailscale 能看到元数据:你的哪台设备连了哪台,以及它们的公网 IP。你用 Google、微软或 GitHub 登录,所以要给那个账号开两步验证——谁控制了它,谁就控制了你的 tailnet。

2 ⬇️ Install it · ติดตั้ง · 安装

🇬🇧 English

Install Tailscale on at least two devices. One device alone has nobody to talk to. A laptop and a phone is a good start.

Use the same login on every device. That is what puts them in the same tailnet.

🇹🇭 ไทย

ติดตั้ง Tailscale อย่างน้อยสองเครื่อง เครื่องเดียวไม่มีใครให้คุยด้วย แล็ปท็อปกับโทรศัพท์เป็นจุดเริ่มต้นที่ดี

ใช้บัญชีเดียวกันล็อกอินทุกเครื่อง นั่นคือสิ่งที่ทำให้อยู่ใน tailnet เดียวกัน

🇨🇳 中文

至少在两台设备上安装 Tailscale。只有一台就没人可以通信。笔记本加手机是个好开始。

每台设备都用同一个账号登录,这样它们才在同一个 tailnet 里。

SystemHow to install · วิธีติดตั้ง · 安装方法
🪟 Windows 10+Download the installer from tailscale.com/download and run it. Click the Tailscale icon near the clock, then Log in.ดาวน์โหลดตัวติดตั้งจาก tailscale.com/download แล้วรัน คลิกไอคอน Tailscale ข้างนาฬิกา แล้วเลือก Log intailscale.com/download 下载安装程序并运行,点时钟旁的 Tailscale 图标,选 Log in
🍎 macOS 12+Use the Standalone download from the same page. It needs no Apple ID. The Mac App Store version works too. It cannot be a Tailscale SSH server.ใช้ตัวดาวน์โหลดแบบ Standalone จากหน้าเดียวกัน ไม่ต้องใช้ Apple ID เวอร์ชัน Mac App Store ก็ใช้ได้ แต่เป็นเซิร์ฟเวอร์ Tailscale SSH ไม่ได้用同一页面上的 Standalone 版本,不需要 Apple ID。Mac App Store 版也能用,但不能当 Tailscale SSH 服务器。
🐧 LinuxOne command, below. It finds your Linux type and uses its normal package manager.คำสั่งเดียว ดูข้างล่าง มันตรวจว่า Linux ของคุณเป็นแบบไหน แล้วใช้ตัวจัดการแพ็กเกจปกติของระบบนั้น一条命令(见下方)。它会识别你的 Linux 类型,用系统自带的包管理器安装。
🤖 Android 8+Install Tailscale from Google Play. Allow the VPN request, then log in.ติดตั้ง Tailscale จาก Google Play อนุญาตคำขอ VPN แล้วล็อกอิน从 Google Play 安装 Tailscale,允许 VPN 请求,然后登录。
📱 iPhone · iPad (iOS 15+)Install Tailscale from the App Store. Tap Get Started, allow the VPN profile, then log in.ติดตั้ง Tailscale จาก App Store แตะ Get Started อนุญาตโปรไฟล์ VPN แล้วล็อกอิน从 App Store 安装 Tailscale,点 Get Started,允许 VPN 配置,然后登录。

⌨️ TERMINAL · Linux, Raspberry Pi OS — install and log in

curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
LineWhat it does · ทำอะไร · 做什么
curl -fsSL https://tailscale.com/install.sh | shDownload Tailscale's install script and run it. -fsSL means: stop on errors, stay quiet, follow redirects.ดาวน์โหลดสคริปต์ติดตั้งของ Tailscale แล้วรัน -fsSL แปลว่า หยุดเมื่อผิดพลาด ทำงานเงียบ ๆ และตามลิงก์ที่ย้ายที่下载 Tailscale 的安装脚本并运行。-fsSL 表示:出错就停、不输出多余信息、跟随跳转。
sudo tailscale upStart Tailscale. It prints a login link. Open the link in any browser and sign in.เริ่ม Tailscale มันพิมพ์ลิงก์ล็อกอินออกมา เปิดลิงก์ในเบราว์เซอร์ไหนก็ได้แล้วลงชื่อเข้าใช้启动 Tailscale,它会打印一个登录链接。在任意浏览器打开并登录。
CAREFUL · PIPING A SCRIPT INTO sh curl … | sh runs a script from the internet with your permissions. Only do this with a site you trust. Type the address yourself. Want to see every step? tailscale.com/kb/1031/install-linux has the package commands. It covers Ubuntu, Debian, Fedora and more. curl … | sh รันสคริปต์จากอินเทอร์เน็ตด้วยสิทธิ์ของคุณ ทำแบบนี้กับเว็บที่เชื่อถือได้เท่านั้น และพิมพ์ที่อยู่เอง ถ้าอยากเห็นทุกขั้นตอน tailscale.com/kb/1031/install-linux มีคำสั่งติดตั้งแพ็กเกจแยกทีละขั้นสำหรับ Ubuntu Debian Fedora และอื่น ๆ curl … | sh 会用你的权限运行一个网上的脚本。只对你信任的网站这样做,并亲手输入地址。想看清每一步的话,tailscale.com/kb/1031/install-linux 列出了 Ubuntu、Debian、Fedora 等系统的分步命令。
YOUR TURN
  1. Install Tailscale on your computer and on your phone.
  2. Log in on both, with the same Google, Microsoft or GitHub account.
  3. Open login.tailscale.com/admin/machines.
  4. Check: you see both devices, and each has a 100. address.
  1. ติดตั้ง Tailscale ในคอมพิวเตอร์และโทรศัพท์ของคุณ
  2. ล็อกอินทั้งสองเครื่องด้วยบัญชี Google Microsoft หรือ GitHub บัญชีเดียวกัน
  3. เปิด login.tailscale.com/admin/machines
  4. ตรวจ: เห็นอุปกรณ์ทั้งสองเครื่อง และแต่ละเครื่องมีที่อยู่ที่ขึ้นต้นด้วย 100.
  1. 在电脑和手机上安装 Tailscale。
  2. 两台都用同一个 Google、微软或 GitHub 账号登录。
  3. 打开 login.tailscale.com/admin/machines
  4. 检查:能看到两台设备,而且各有一个 100. 开头的地址。

3 👀 Look around · สำรวจดู · 四处看看

🇬🇧 English

Five commands tell you almost everything. They only read. They change nothing.

On Windows, run them in PowerShell or Command Prompt. On Mac and Linux, use a terminal. On Linux you may need sudo in front.

🇹🇭 ไทย

คำสั่งห้าคำสั่งบอกเกือบทุกอย่าง มันแค่อ่าน ไม่เปลี่ยนอะไรเลย

บน Windows ให้รันใน PowerShell หรือ Command Prompt บน Mac และ Linux ใช้ terminal บน Linux อาจต้องมี sudo นำหน้า

🇨🇳 中文

五条命令几乎能告诉你一切。它们只读取,不改变任何东西。

Windows 上在 PowerShell 或命令提示符里运行;Mac 和 Linux 用终端。Linux 上可能要在前面加 sudo

⌨️ TERMINAL · any system — read-only checks

tailscale status
tailscale ip
tailscale ping spark
tailscale netcheck
tailscale version
LineWhat it does · ทำอะไร · 做什么
tailscale statusList every device in your tailnet. Each line shows its address, name and connection.แสดงทุกอุปกรณ์ใน tailnet: ที่อยู่ ชื่อ เจ้าของ ระบบ และสถานะการเชื่อมต่อ列出 tailnet 里的每台设备:地址、名字、所有者、系统和连接状态。
tailscale ipShow this device's Tailscale addresses, IPv4 and IPv6. Add -4 for only IPv4.แสดงที่อยู่ Tailscale ของเครื่องนี้ ทั้ง IPv4 และ IPv6 เติม -4 เพื่อดูแค่ IPv4显示本机的 Tailscale 地址(IPv4 和 IPv6)。加 -4 只看 IPv4。
tailscale ping sparkPing another device by name through Tailscale. It says if the path is direct or goes via DERP. Use your own device's name.ping อุปกรณ์อื่นด้วยชื่อผ่าน Tailscale มันบอกว่าเส้นทางตรงหรือผ่าน DERP ใช้ชื่ออุปกรณ์ของคุณเอง通过 Tailscale 按名字 ping 另一台设备,会告诉你路径是直连还是经过 DERP。换成你自己设备的名字。
tailscale netcheckTest your current network: does UDP work, and which relay is nearest?ทดสอบเครือข่ายที่ใช้อยู่: UDP ใช้ได้ไหม และ relay ไหนใกล้ที่สุด检测你当前的网络:UDP 能不能用,最近的中继是哪个。
tailscale versionShow the version. Old versions miss features and fixes.แสดงเวอร์ชัน เวอร์ชันเก่าจะขาดฟีเจอร์และการแก้ไข显示版本。旧版本会缺少功能和修复。

what it printed on our laptop (addresses shortened)

> tailscale status
100.95.62.45    laptop       you@  windows  -
100.105.80.100  spark        you@  linux    active; direct 192.168.10.104:55388
100.100.176.50  twenty       you@  linux    offline, last seen 42d ago

> tailscale ping spark
pong from spark (100.105.80.100) via [2405:9800:…]:34319 in 90ms

> tailscale netcheck
        * UDP: true
        * Nearest DERP: Singapore
HOW TO READ IT - means the device is online but idle. active; direct is the best result. The traffic goes straight between the devices. relay "sin" would mean it goes through the Singapore relay. That still works, just slower. offline means that device is off, or Tailscale is stopped on it. - แปลว่าเครื่องออนไลน์แต่ว่างอยู่ active; direct ดีที่สุด ข้อมูลวิ่งตรงระหว่างสองเครื่อง ถ้าเห็น relay "sin" แปลว่าผ่าน relay ที่สิงคโปร์ ยังใช้ได้แต่ช้ากว่า offline แปลว่าเครื่องนั้นปิดอยู่ หรือ Tailscale บนเครื่องนั้นหยุดทำงาน - 表示设备在线但空闲。active; direct 是最好的结果:流量在两台设备之间直接传输。relay "sin" 表示经过新加坡的中继,仍然能用,只是慢一些。offline 表示那台设备关着,或者上面的 Tailscale 停了。
YOUR TURN
  1. On your computer, run tailscale status. Find your phone's name.
  2. Run tailscale ping with your phone's name.
  3. Check: you get a pong. Is it via DERP or a direct address?
  4. Now turn off your phone's Wi-Fi and use mobile data. Ping again. The address stays the same.
  1. บนคอมพิวเตอร์ รัน tailscale status แล้วหาชื่อโทรศัพท์ของคุณ
  2. รัน tailscale ping ตามด้วยชื่อโทรศัพท์
  3. ตรวจ: ได้ pong กลับมา เป็น via DERP หรือที่อยู่ตรง
  4. ปิด Wi-Fi ในโทรศัพท์แล้วใช้เน็ตมือถือ ping อีกครั้ง ที่อยู่ยังเหมือนเดิม
  1. 在电脑上运行 tailscale status,找到你手机的名字。
  2. 运行 tailscale ping 加上手机的名字。
  3. 检查:收到 pong。是 via DERP 还是直连地址?
  4. 把手机 Wi-Fi 关掉改用流量,再 ping 一次。地址还是一样的。

4 🔌 Use another device · ใช้งานเครื่องอื่น · 使用另一台设备

🇬🇧 English

Two devices are now in your tailnet. Use a device's name instead of its address. This is MagicDNS. It is on by default.

The short name, like spark, works inside your tailnet. The full name looks like spark.your-tailnet.ts.net. Find yours on the DNS page of the admin console.

The app must listen on the network. Listening only on localhost is not enough. Otherwise Tailscale has nothing to connect to.

🇹🇭 ไทย

เมื่อสองเครื่องอยู่ใน tailnet แล้ว ใช้ชื่อของอีกเครื่องแทนที่อยู่ได้ทุกที่ นี่คือ MagicDNS ซึ่งเปิดไว้ตั้งแต่แรก

ชื่อสั้นอย่าง spark ใช้ได้ภายใน tailnet ชื่อเต็มหน้าตาแบบ spark.your-tailnet.ts.net ดูชื่อของคุณได้ที่หน้า DNS ในหน้าผู้ดูแล

แอปบนอีกเครื่องต้องรอรับการเชื่อมต่อจากเครือข่าย ไม่ใช่แค่ localhost ไม่อย่างนั้น Tailscale ไม่มีอะไรให้เชื่อมต่อ

🇨🇳 中文

两台设备都在 tailnet 里之后,凡是要填地址的地方,都可以填另一台设备的名字。这就是 MagicDNS,默认开启。

短名字(如 spark)在你的 tailnet 内可用。完整名字形如 spark.your-tailnet.ts.net,在管理后台的 DNS 页面可以找到你的。

另一台设备上的应用必须监听网络,而不能只监听 localhost,否则 Tailscale 没有东西可连。

⌨️ TERMINAL · from your laptop — reach apps on a device called spark

curl http://spark:11434/api/tags
ssh you@spark
LineWhat it does · ทำอะไร · 做什么
curl http://spark:11434/api/tagsAsk Ollama on spark for its model list, by name. Port 11434 is Ollama's port. Swap in any web app and port you run.ถาม Ollama บน spark ว่ามีโมเดลอะไรบ้าง โดยใช้ชื่อเครื่อง พอร์ต 11434 คือพอร์ตของ Ollama เปลี่ยนเป็นเว็บแอปและพอร์ตของคุณได้按名字向 spark 上的 Ollama 要模型列表。11434 是 Ollama 的端口,可以换成你自己跑的任何网页应用和端口。
ssh you@sparkOpen a normal SSH login on spark, through the tailnet. Your SSH keys and passwords work as usual.เปิด SSH แบบปกติไปที่ spark ผ่าน tailnet กุญแจ SSH และรหัสผ่านใช้ได้ตามปกติ通过 tailnet 普通地 SSH 登录 spark,你的 SSH 密钥和密码照常使用。

Optional: Tailscale SSH · ไม่บังคับ: Tailscale SSH · 可选:Tailscale SSH

🇬🇧 English

Tailscale can also run the SSH server itself. Then your tailnet login replaces SSH keys. The access rules decide who may log in as which user.

The server side works on Linux and the standalone macOS app. Any device can connect to it.

🇹🇭 ไทย

Tailscale รันเซิร์ฟเวอร์ SSH เองได้ด้วย แล้วการล็อกอิน tailnet จะใช้แทนกุญแจ SSH กฎการเข้าถึงเป็นตัวกำหนดว่าใครล็อกอินเป็นผู้ใช้คนไหนได้

ฝั่งเซิร์ฟเวอร์ใช้ได้บน Linux และแอป macOS แบบ Standalone อุปกรณ์ไหนก็เชื่อมต่อเข้าไปได้

🇨🇳 中文

Tailscale 也可以自己当 SSH 服务器,这样 tailnet 登录就代替了 SSH 密钥,由访问规则决定谁能以哪个用户登录。

服务器端支持 LinuxmacOS Standalone 版,任何设备都可以连上去。

⌨️ TERMINAL · on the Linux device you want to log in to

sudo tailscale set --ssh
THE TRAP Turning on Tailscale SSH can freeze open SSH sessions to that device. So do not run it over a Tailscale connection. Use the device's own keyboard. Or connect with its normal network address. Turn it off again with sudo tailscale set --ssh=false. การเปิด Tailscale SSH อาจทำให้ SSH ที่เปิดค้างอยู่กับที่อยู่ Tailscale ของเครื่องนั้นค้าง ให้รันจากคีย์บอร์ดของเครื่องนั้นเอง หรือผ่านที่อยู่เครือข่ายปกติ ไม่ใช่ผ่านที่อยู่ Tailscale ที่กำลังใช้อยู่ ปิดได้ด้วย sudo tailscale set --ssh=false 打开 Tailscale SSH 可能会让已经连到该设备 Tailscale 地址的 SSH 会话卡住。请在那台设备本机键盘上执行,或者通过普通网络地址执行,不要通过你正在用的 Tailscale 地址。关闭用 sudo tailscale set --ssh=false
YOUR TURN
  1. On one computer, start any small web server. For example: python -m http.server 8000.
  2. On your phone, keep Tailscale on and open a browser.
  3. Go to http://, then the computer's Tailscale name, then :8000.
  4. Check: you see the computer's file list, even on mobile data.
  5. Press Ctrl+C on the computer to stop the server.
  1. บนคอมพิวเตอร์เครื่องหนึ่ง เปิดเว็บเซิร์ฟเวอร์เล็ก ๆ เช่น python -m http.server 8000
  2. ในโทรศัพท์ เปิด Tailscale ไว้ แล้วเปิดเบราว์เซอร์
  3. ไปที่ http:// ตามด้วยชื่อ Tailscale ของคอมพิวเตอร์ แล้วตามด้วย :8000
  4. ตรวจ: เห็นรายการไฟล์ของคอมพิวเตอร์ แม้ใช้เน็ตมือถือ
  5. กด Ctrl+C บนคอมพิวเตอร์เพื่อหยุดเซิร์ฟเวอร์
  1. 在一台电脑上启动一个小网页服务器,比如 python -m http.server 8000
  2. 手机上保持 Tailscale 开启,打开浏览器。
  3. 访问 http:// 加电脑的 Tailscale 名字,再加 :8000
  4. 检查:即使用手机流量,也能看到电脑上的文件列表。
  5. 在电脑上按 Ctrl+C 停止服务器。

5 🌐 Share a web app: Serve and Funnel · แชร์เว็บแอป: Serve และ Funnel · 分享网页应用:Serve 和 Funnel

🇬🇧 English

Your app runs on localhost:3000. Two commands give it a real HTTPS address with a valid certificate.

Serve shares it with devices in your tailnet only. Funnel shares it with the whole internet. Anyone with the link can open it, with no Tailscale app.

Both need HTTPS certificates first. Turn them on in the admin console's DNS page. Funnel also needs permission in your access rules. The first time, the command tells you what to enable.

🇹🇭 ไทย

แอปของคุณรันที่ localhost:3000 คำสั่งสองคำสั่งให้ที่อยู่ HTTPS จริงพร้อมใบรับรองที่ถูกต้อง

Serve แชร์ให้เฉพาะอุปกรณ์ใน tailnet ของคุณ Funnel แชร์ให้ทั้งอินเทอร์เน็ต ใครมีลิงก์ก็เปิดได้ โดยไม่ต้องมีแอป Tailscale

ทั้งสองต้องเปิด HTTPS certificates ก่อน ที่หน้า DNS ในหน้าผู้ดูแล Funnel ต้องได้รับอนุญาตในกฎการเข้าถึงด้วย ครั้งแรกคำสั่งจะบอกว่าต้องเปิดอะไร

🇨🇳 中文

你的应用跑在 localhost:3000。两条命令就能给它一个带有效证书的真正 HTTPS 地址。

Serve 只分享给你 tailnet 里的设备。Funnel 分享给整个互联网:谁有链接谁就能打开,不需要装 Tailscale。

两者都要先在管理后台 DNS 页面打开 HTTPS certificates。Funnel 还需要在访问规则里授权。第一次运行时,命令会告诉你要打开什么。

ServeFunnel
Who can open itใครเปิดได้谁能打开Your tailnet onlyเฉพาะ tailnet ของคุณ只有你的 tailnetEveryone on the internetทุกคนบนอินเทอร์เน็ต互联网上的所有人
Addressที่อยู่地址https://laptop.your-tailnet.ts.nethttps://laptop.your-tailnet.ts.net
Portsพอร์ต端口Anyพอร์ตไหนก็ได้任意443, 8443, 10000

⌨️ TERMINAL · on the device where the app runs

tailscale serve --bg 3000
tailscale serve status
tailscale serve reset
tailscale funnel --bg 3000
tailscale funnel reset
LineWhat it does · ทำอะไร · 做什么
tailscale serve --bg 3000Share http://127.0.0.1:3000 as HTTPS inside your tailnet. --bg keeps it on after you close the terminal. Without it, Ctrl+C stops it.แชร์ http://127.0.0.1:3000 เป็น HTTPS ภายใน tailnet --bg ทำให้ยังเปิดอยู่หลังปิด terminal ถ้าไม่ใส่ Ctrl+C จะหยุดมันhttp://127.0.0.1:3000 作为 HTTPS 分享到 tailnet 内。--bg 让它在关掉终端后继续运行;不加的话按 Ctrl+C 就停。
tailscale serve statusShow what this device shares, and where.แสดงว่าเครื่องนี้แชร์อะไรไว้ และแชร์ที่ไหน显示本机分享了什么、分享到哪里。
tailscale serve resetStop sharing. Remove all Serve settings on this device.หยุดแชร์ ลบการตั้งค่า Serve ทั้งหมดบนเครื่องนี้停止分享,清除本机所有 Serve 设置。
tailscale funnel --bg 3000Share the same app with the whole internet.แชร์แอปเดียวกันให้ทั้งอินเทอร์เน็ต把同一个应用分享给整个互联网
tailscale funnel resetTurn Funnel off again.ปิด Funnel อีกครั้ง再把 Funnel 关掉。

tailscale serve status — a real one from our DGX Spark

# Funnel on:
#     - https://spark-wav2lip-1.taila00da8.ts.net

https://spark-wav2lip-1.taila00da8.ts.net (Funnel on)
|-- / proxy http://127.0.0.1:7861

🇬🇧 English

That is our live English-tutor avatar. It runs at home on port 7861. Funnel gives it a public HTTPS address. Our router has no open ports. Students open the link on any phone.

🇹🇭 ไทย

นั่นคืออวาตาร์ครูสอนภาษาอังกฤษของเราที่ใช้งานจริง รันอยู่ที่บ้านบนพอร์ต 7861 และ Funnel ให้ที่อยู่ HTTPS สาธารณะ เราเตอร์ของเราไม่ได้เปิดพอร์ตเลย นักเรียนเปิดลิงก์ได้จากโทรศัพท์เครื่องไหนก็ได้

🇨🇳 中文

这是我们正在使用的英语辅导虚拟人。它在家里的 7861 端口运行,Funnel 给了它一个公开的 HTTPS 地址。我们的路由器没有开任何端口,学生用任何手机都能打开链接。

CAREFUL · FUNNEL IS THE PUBLIC INTERNET Funnel does not add a password. Does your app have no login? Then anyone with the address can use it. Scanners find new addresses quickly. Never Funnel an admin page or a database. Never Funnel tools with no login, like ComfyUI or Jupyter. Use Serve for anything private. Run tailscale funnel status on every device. Turn off what you do not need. Funnel ไม่ได้เพิ่มรหัสผ่านให้ ถ้าแอปของคุณไม่มีการล็อกอิน ใครก็ได้ที่เจอที่อยู่ก็ใช้ได้ โปรแกรมสแกนหาที่อยู่ใหม่ได้เร็วมาก อย่า Funnel หน้าผู้ดูแล ฐานข้อมูล หรือเครื่องมืออย่าง ComfyUI หรือ Jupyter ที่ไม่มีการล็อกอิน ใช้ Serve กับทุกอย่างที่เป็นส่วนตัว ตรวจด้วย tailscale funnel status ในทุกเครื่อง แล้วปิดสิ่งที่ไม่ใช้ Funnel 不会给你加密码。如果你的应用没有登录,任何人找到地址都能用,扫描器很快就会发现新地址。千万不要用 Funnel 公开管理页面、数据库,或者 ComfyUI、Jupyter 这类没有登录的工具。私密的东西用 Serve。在每台设备上用 tailscale funnel status 检查,把不需要的关掉。
YOUR TURN
  1. Start the small server again: python -m http.server 8000.
  2. In a second terminal, run tailscale serve --bg 8000. If it asks you to enable HTTPS, follow its link.
  3. Check: on your phone, open the https:// address it printed. The lock icon shows a valid certificate.
  4. Clean up: tailscale serve reset, then Ctrl+C on the server. Only use Funnel on a page strangers may see.
  1. เปิดเซิร์ฟเวอร์เล็ก ๆ อีกครั้ง: python -m http.server 8000
  2. ใน terminal ที่สอง รัน tailscale serve --bg 8000 ถ้ามันขอให้เปิด HTTPS ให้ทำตามลิงก์
  3. ตรวจ: ในโทรศัพท์ เปิดที่อยู่ https:// ที่มันพิมพ์ออกมา ไอคอนกุญแจแสดงว่าใบรับรองถูกต้อง
  4. เก็บกวาด: tailscale serve reset แล้วกด Ctrl+C ที่เซิร์ฟเวอร์ ลอง Funnel เฉพาะกับหน้าที่ยอมให้คนแปลกหน้าเห็นได้
  1. 再启动小服务器:python -m http.server 8000
  2. 在第二个终端运行 tailscale serve --bg 8000。如果它要求打开 HTTPS,就按它给的链接操作。
  3. 检查:在手机上打开它打印出的 https:// 地址,锁形图标表示证书有效。
  4. 收尾:运行 tailscale serve reset,再在服务器上按 Ctrl+C。只有愿意让陌生人看到的页面才去试 Funnel。

6 ⚙️ Configure it · ตั้งค่า · 配置

set, not up · ใช้ set ไม่ใช่ up · 用 set,别用 up

🇬🇧 English

Use tailscale set to change one setting. It changes only the settings you name.

tailscale up with settings is different. You must repeat every setting you want to keep. Forget one, and it stops with an error. The error shows the full command.

🇹🇭 ไทย

ใช้ tailscale set เพื่อเปลี่ยนการตั้งค่าทีละอย่าง มันเปลี่ยนเฉพาะค่าที่คุณระบุ

tailscale up ที่ใส่การตั้งค่าไม่เหมือนกัน คุณต้องใส่ทุกค่าที่อยากเก็บไว้ซ้ำอีกครั้ง ถ้าลืมไปหนึ่งค่า มันจะหยุดพร้อม error และแสดงคำสั่งเต็มที่ควรใช้

🇨🇳 中文

改一个设置用 tailscale set,它只改你写出来的设置。

带设置的 tailscale up 不一样:你想保留的每一个设置都得重新写一遍。漏了一个,它会报错停下,并给出应该用的完整命令。

Four settings worth knowing · การตั้งค่าสี่อย่างที่ควรรู้ · 值得知道的四个设置

SettingWhat it does, and where · ทำอะไร และตั้งที่ไหน · 作用和位置
Key expiryEvery device must log in again after 180 days. When its key expires, its connections stop. Turn this off for a home server. Go to admin console → Machines → the device's menu. Choose Disable key expiry.ทุกเครื่องต้องล็อกอินใหม่ทุก 180 วัน เมื่อกุญแจหมดอายุ การเชื่อมต่อจะหยุด สำหรับเซิร์ฟเวอร์ที่บ้านให้ปิด: หน้าผู้ดูแล → Machines → เมนูของเครื่อง → Disable key expiry每台设备 180 天后要重新登录,密钥过期后连接就断了。家里的服务器建议关掉:管理后台 → Machines → 设备菜单 → Disable key expiry
Device approvalNew devices must wait until you approve them. Turn it on in the admin console under Device management. Free on every plan.อุปกรณ์ใหม่ต้องรอให้คุณอนุมัติก่อน เปิดได้ในหน้าผู้ดูแล ส่วน Device management ใช้ได้ฟรีทุกแพ็กเกจ新设备要等你批准才能加入。在管理后台的 Device management 里打开,所有套餐都免费。
Exit nodeSend all your internet traffic through one of your devices. Useful on café Wi-Fi: you browse as if you were at home.ส่งการใช้อินเทอร์เน็ตทั้งหมดผ่านเครื่องหนึ่งของคุณ มีประโยชน์เมื่อใช้ Wi-Fi ร้านกาแฟ เหมือนท่องเว็บจากที่บ้าน让你所有上网流量都经过你的某台设备。在咖啡馆 Wi-Fi 上很有用:就像在家里上网一样。
Subnet routerReach home devices that cannot run Tailscale. A printer or a camera are examples.ให้ tailnet เข้าถึงอุปกรณ์ที่ติดตั้ง Tailscale ไม่ได้ เช่น เครื่องพิมพ์หรือกล้องในเครือข่ายที่บ้าน让你的 tailnet 访问装不了 Tailscale 的设备,比如家里网络上的打印机或摄像头。

⌨️ TERMINAL · on a Linux device that will be the exit node or subnet router

echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
sudo sysctl -p /etc/sysctl.d/99-tailscale.conf
sudo tailscale set --advertise-exit-node
sudo tailscale set --advertise-routes=192.168.10.0/24
LineWhat it does · ทำอะไร · 做什么
echo 'net.ipv4.ip_forward = 1' | sudo tee -a … echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a …Write two settings to a file. They allow Linux to pass traffic on for other devices. Linux blocks that by default.เขียนการตั้งค่าสองอย่างลงไฟล์ ให้ Linux ส่งต่อข้อมูลให้เครื่องอื่นได้ ปกติ Linux ปิดไว้把两条设置写进文件,允许 Linux 替其他设备转发流量。Linux 默认是禁止的。
sudo sysctl -p /etc/sysctl.d/99-tailscale.confLoad the file now. It also loads again after every restart.โหลดไฟล์นั้นตอนนี้เลย และจะโหลดอีกทุกครั้งที่รีสตาร์ต现在就加载这个文件,以后每次重启也会加载。
sudo tailscale set --advertise-exit-nodeOffer this device as an exit node.เสนอให้เครื่องนี้เป็น exit node把本机提供为出口节点。
sudo tailscale set --advertise-routes=192.168.10.0/24Offer your home network as a subnet route. Use your own network's range.เสนอเครือข่ายที่บ้านเป็น subnet route ใช้ช่วงที่อยู่ของเครือข่ายคุณเอง把家庭网络作为子网路由提供出去。换成你自己网络的地址段。
CAREFUL · OFFERING IS NOT USING Advertising does nothing yet. First approve it in the admin console. Go to Machines → the device's menu → Edit route settings. Then choose to use it. On a laptop, run sudo tailscale set --exit-node=spark. Or pick it in the app's Exit Node menu. Linux devices must also accept routes: sudo tailscale set --accept-routes. To stop using the exit node: sudo tailscale set --exit-node=. การประกาศยังไม่ทำอะไร ต้องอนุมัติก่อน: หน้าผู้ดูแล → Machines → เมนูของเครื่อง → Edit route settings แล้วจึงเลือกใช้ บนแล็ปท็อปรัน sudo tailscale set --exit-node=spark หรือเลือกในเมนู Exit Node ของแอป เครื่อง Linux ต้องรับ route ด้วย: sudo tailscale set --accept-routes เลิกใช้ exit node ด้วย sudo tailscale set --exit-node= 只是宣布还不会生效。先批准:管理后台 → Machines → 设备菜单 → Edit route settings。然后选择使用:笔记本上运行 sudo tailscale set --exit-node=spark,或在应用的 Exit Node 菜单里选。Linux 设备还要接受路由:sudo tailscale set --accept-routes。停止使用出口节点:sudo tailscale set --exit-node=

Access rules: who can reach what · กฎการเข้าถึง: ใครเข้าถึงอะไรได้ · 访问规则:谁能访问什么

🇬🇧 English

By default, every device in your tailnet can reach every other device. That is fine for one person. When you add other people, write rules.

Rules live in one file, on the admin console's Access controls page. Tailscale now recommends grants. A tag names a group of machines, like tag:server. Once you write rules, anything not allowed is blocked.

🇹🇭 ไทย

ค่าเริ่มต้นคือทุกเครื่องใน tailnet เข้าถึงทุกเครื่องได้ ใช้คนเดียวไม่เป็นไร แต่เมื่อเพิ่มคนอื่นเข้ามา ให้เขียนกฎ

กฎอยู่ในไฟล์เดียว ที่หน้า Access controls ในหน้าผู้ดูแล ตอนนี้ Tailscale แนะนำให้ใช้ grants ส่วน tag คือชื่อกลุ่มเครื่อง เช่น tag:server เมื่อเขียนกฎแล้ว อะไรที่ไม่ได้อนุญาตจะถูกบล็อก

🇨🇳 中文

默认情况下,tailnet 里的每台设备都能访问其他所有设备。一个人用没问题;加入其他人时,就要写规则。

规则都在一个文件里,位于管理后台的 Access controls 页面。Tailscale 现在推荐用 grantstag(标签)是一组机器的名字,比如 tag:server。写了规则之后,没被允许的就会被挡住。

✏️ CHANGE · admin console → Access controls — a small policy for a class

{
  // Only the teacher may put the server tag on a machine.
  "tagOwners": {
    "tag:server": ["teacher@example.com"],
  },
  "grants": [
    // Everyone may use the class server's web apps.
    {"src": ["autogroup:member"], "dst": ["tag:server"], "ip": ["tcp:443", "tcp:11434"]},
    // The teacher may reach everything.
    {"src": ["teacher@example.com"], "dst": ["*"], "ip": ["*"]},
  ],
}
LineWhat it does · ทำอะไร · 做什么
// …A comment. The file is HuJSON. It is JSON that allows comments and extra commas.คอมเมนต์ ไฟล์นี้เป็น HuJSON คือ JSON ที่ใส่คอมเมนต์และจุลภาคหลังรายการสุดท้ายได้注释。这个文件是 HuJSON:允许注释、允许最后一项后面有逗号的 JSON。
"tagOwners": {"tag:server": ["teacher@example.com"]}Only this person may give a machine the tag tag:server.เฉพาะคนนี้เท่านั้นที่ติดแท็ก tag:server ให้เครื่องได้只有这个人可以给机器打上 tag:server 标签。
"src": ["autogroup:member"], "dst": ["tag:server"], "ip": ["tcp:443", "tcp:11434"]Every member may reach tag:server machines. Only ports 443 and 11434 are open.สมาชิกทุกคนเข้าถึงเครื่องที่ติดแท็ก tag:server ได้ แต่เฉพาะพอร์ต 443 และ 11434所有成员都能访问带 tag:server 的机器,但只限 443 和 11434 端口。
"src": ["teacher@example.com"], "dst": ["*"], "ip": ["*"]The teacher may reach every machine, on every port.ครูเข้าถึงได้ทุกเครื่อง ทุกพอร์ต老师可以访问所有机器的所有端口。
THE TRAP Saving new rules can lock you out of your own machines. Use the Preview rules tab first. Keep one rule that lets you reach everything until the others work. Each device checks the rules itself. So a mistake takes effect in seconds. การบันทึกกฎใหม่อาจทำให้คุณเข้าเครื่องของตัวเองไม่ได้ ใช้แท็บ Preview rules ก่อน เก็บกฎหนึ่งข้อที่ให้คุณเข้าถึงได้ทุกอย่างไว้ จนกว่ากฎอื่นจะใช้ได้ กฎถูกตรวจบนแต่ละเครื่อง ความผิดพลาดจึงมีผลภายในไม่กี่วินาที 保存新规则可能把你自己锁在机器外面。先用 Preview rules 标签页预览。在其他规则确认可用之前,保留一条让你能访问所有东西的规则。规则在每台设备上执行,所以写错几秒钟就会生效。

Servers with no screen: auth keys · เซิร์ฟเวอร์ที่ไม่มีหน้าจอ: auth key · 没有屏幕的服务器:auth key

🇬🇧 English

A server or a container cannot open a browser to log in. Give it an auth key instead. Make one in the admin console under Settings → Keys. A key lasts 1 to 90 days. Devices that joined with it stay when the key expires.

Choose the options with care. Reusable keys can add many machines, so guard them like a password. Ephemeral removes the machine when it goes offline. Tags give the machine a tag, and tagged machines do not expire.

🇹🇭 ไทย

เซิร์ฟเวอร์หรือคอนเทนเนอร์เปิดเบราว์เซอร์เพื่อล็อกอินไม่ได้ ให้ใช้ auth key แทน สร้างได้ในหน้าผู้ดูแล ที่ Settings → Keys กุญแจมีอายุ 1 ถึง 90 วัน เครื่องที่เข้าร่วมด้วยกุญแจนั้นยังอยู่ใน tailnet แม้กุญแจหมดอายุแล้ว

เลือกตัวเลือกให้ดี กุญแจแบบ Reusable เพิ่มได้หลายเครื่อง จึงต้องเก็บรักษาเหมือนรหัสผ่าน Ephemeral จะลบเครื่องเมื่อออฟไลน์ Tags ติดแท็กให้เครื่อง และเครื่องที่ติดแท็กจะไม่หมดอายุ

🇨🇳 中文

服务器或容器没法打开浏览器登录,那就给它一个 auth key。在管理后台 Settings → Keys 里创建,有效期 1 到 90 天。用它加入的设备在密钥过期后仍留在 tailnet 里。

选项要慎重。Reusable(可重复用)的密钥能加很多台机器,要像密码一样保管。Ephemeral(临时)表示机器离线后自动移除。Tags 给机器打标签,打了标签的机器不会过期。

⌨️ TERMINAL · on the server — join with a key instead of a browser

sudo tailscale up --auth-key=tskey-auth-XXXXXXXXXXXX --hostname=class-server

7 🐳 Tailscale in Docker · Tailscale ใน Docker · Docker 里的 Tailscale

🇬🇧 English

You can give one app its own tailnet name. Run a small Tailscale container beside it, a sidecar. The app then appears as its own machine. It gets its own HTTPS address.

This is how our CRM got its own address. The files below are based on the ones we ran. The app is now a simple web server. Funnel is left off.

🇹🇭 ไทย

คุณให้แอปหนึ่งตัวมีชื่อใน tailnet ของตัวเองได้ โดยรันคอนเทนเนอร์ Tailscale เล็ก ๆ ข้าง ๆ เรียกว่า sidecar แอปจะปรากฏใน tailnet เป็นเครื่องหนึ่ง พร้อมที่อยู่ HTTPS ของตัวเอง

นี่คือวิธีที่ CRM ของเราได้ที่อยู่ของตัวเอง ไฟล์ข้างล่างดัดแปลงจากไฟล์ที่เราใช้จริง เปลี่ยนแอปเป็นเว็บเซิร์ฟเวอร์ธรรมดา และไม่เปิด Funnel

🇨🇳 中文

你可以给一个应用单独的 tailnet 名字:在它旁边跑一个小小的 Tailscale 容器,叫 sidecar(边车)。这个应用就会作为一台独立机器出现在 tailnet 里,有自己的 HTTPS 地址。

我们的 CRM 就是这样有了自己的地址。下面的文件改编自我们实际用过的:应用换成了简单的网页服务器,也没有打开 Funnel。

📄 NEW FILE · docker-compose.yml — in your app's folder

services:
  app:
    image: nginx:alpine                 # your app; this one listens on port 80

  app-tailscale:
    image: tailscale/tailscale:latest
    environment:
      TS_AUTHKEY: ${TS_AUTHKEY}         # put the key in a .env file, never in this file
      TS_HOSTNAME: myapp
      TS_STATE_DIR: /var/lib/tailscale
      TS_USERSPACE: "true"
      TS_ACCEPT_DNS: "false"
      TS_SERVE_CONFIG: /config/serve.json
    volumes:
      - ts-state:/var/lib/tailscale
      - ./serve.json:/config/serve.json:ro
    restart: unless-stopped

volumes:
  ts-state:

📄 NEW FILE · serve.json — next to docker-compose.yml

{
  "TCP": { "443": { "HTTPS": true } },
  "Web": {
    "${TS_CERT_DOMAIN}:443": {
      "Handlers": { "/": { "Proxy": "http://app:80" } }
    }
  }
}
LineWhat it does · ทำอะไร · 做什么
TS_AUTHKEY: ${TS_AUTHKEY}Log in with an auth key. Docker reads the real key from a .env file. The key never goes in the compose file.ล็อกอินด้วย auth key Docker อ่านค่าจริงจากไฟล์ .env กุญแจจึงไม่อยู่ในไฟล์ compose用 auth key 登录。Docker 从 .env 文件读取真实值,所以密钥不会出现在 compose 文件里。
TS_HOSTNAME: myappThe machine name. The address becomes https://myapp.your-tailnet.ts.net.ชื่อเครื่อง ที่อยู่จะกลายเป็น https://myapp.your-tailnet.ts.net机器名。地址就变成 https://myapp.your-tailnet.ts.net
TS_STATE_DIR + the ts-state volumeKeep the login between restarts. Without this volume, every restart adds a new machine.เก็บการล็อกอินไว้ข้ามการรีสตาร์ต ถ้าไม่มี volume นี้ ทุกครั้งที่รีสตาร์ตจะได้เครื่องใหม่เพิ่มขึ้น在重启之间保留登录状态。没有这个卷,每次重启都会多出一台新机器。
TS_USERSPACE: "true"Run without a network device. It needs no extra permissions.รันโดยไม่ต้องใช้อุปกรณ์เครือข่าย ไม่ต้องขอสิทธิ์เพิ่ม不使用网络设备运行,不需要额外权限。
TS_ACCEPT_DNS: "false"Leave the container's DNS alone. Then Docker can still find app by name.ไม่แตะ DNS ของคอนเทนเนอร์ Docker จึงยังหา app ด้วยชื่อได้不改容器的 DNS,这样 Docker 仍能按名字找到 app
TS_SERVE_CONFIG + serve.jsonTurn on Serve from a file. ${TS_CERT_DOMAIN} becomes this machine's address. Requests go to http://app:80.เปิด Serve จากไฟล์ ${TS_CERT_DOMAIN} จะกลายเป็นที่อยู่ของเครื่องนี้ คำขอถูกส่งไปที่ http://app:80从文件开启 Serve。${TS_CERT_DOMAIN} 会变成这台机器的地址,请求转发到 http://app:80
THREE TRAPS WE HIT ON OUR OWN SERVER 1. Do not share the app's network. Many guides use network_mode: service:app. On our DGX Spark, that broke Docker's DNS. The HTTPS certificate then failed. A separate network plus a proxy by service name, as above, worked. 2. Two Tailscales on one host need different device names. Our host ran Tailscale, plus containers using host networking. After a reboot the containers crashed with device or resource busy. They all wanted the device tailscale0. Giving each its own name fixed it: tailscaled --tun=tailscale1, --tun=tailscale2. 3. "Logged out" on the host can be fine. On our server, tailscale status says Logged out. That is fine. The containers are the tailnet nodes. Each has its own state. Do not "fix" the host. 1. อย่าใช้เครือข่ายร่วมกับแอป คู่มือหลายที่ใช้ network_mode: service:app บน DGX Spark ของเรา วิธีนี้ทำ DNS ของ Docker พัง และออกใบรับรอง HTTPS ไม่ได้ ใช้เครือข่ายแยกแล้วส่งต่อด้วยชื่อ service แบบข้างบนจึงใช้ได้ 2. Tailscale สองตัวบนเครื่องเดียวต้องใช้ชื่ออุปกรณ์ต่างกัน เครื่องของเรารัน Tailscale บนโฮสต์ พร้อมคอนเทนเนอร์ที่ใช้เครือข่ายโฮสต์ หลังรีสตาร์ต คอนเทนเนอร์พังด้วยข้อความ device or resource busy เพราะทุกตัวอยากใช้ tailscale0 แก้โดยให้แต่ละตัวมีชื่อของตัวเอง: tailscaled --tun=tailscale1 และ --tun=tailscale2 3. "Logged out" บนโฮสต์อาจไม่ใช่ปัญหา tailscale status บนเซิร์ฟเวอร์ของเราขึ้นว่า Logged out. เพราะเครื่องใน tailnet คือคอนเทนเนอร์ ซึ่งแต่ละตัวมีสถานะของตัวเอง อย่าไป "แก้" โฮสต์ 1. 不要和应用共用网络。很多教程用 network_mode: service:app。在我们的 DGX Spark 上,这弄坏了 Docker 的 DNS,HTTPS 证书签发不下来。像上面那样用独立网络、按服务名转发,才成功。 2. 一台主机上的两个 Tailscale 要用不同的设备名。我们的主机本身跑着 Tailscale,还有使用主机网络的容器。重启后容器报 device or resource busy 崩溃,因为它们都想用 tailscale0。给每个一个自己的名字就好了:tailscaled --tun=tailscale1--tun=tailscale2 3. 主机上显示 "Logged out" 可能没问题。我们服务器上 tailscale status 显示 Logged out.,因为 tailnet 节点是那些容器,各自有自己的状态。不要去"修"主机。
YOUR TURN
  1. Make an auth key: admin console → Settings → Keys. Copy it.
  2. In a new folder, create docker-compose.yml and serve.json from above.
  3. Create a file called .env with one line: TS_AUTHKEY= and your key.
  4. Run docker compose up -d.
  5. Check: myapp appears in tailscale status. Open https://myapp. + your tailnet name + .ts.net. You see the nginx welcome page.
  6. Clean up: docker compose down -v, then remove myapp in the admin console.
  1. สร้าง auth key: หน้าผู้ดูแล → Settings → Keys แล้วคัดลอก
  2. ในโฟลเดอร์ใหม่ สร้าง docker-compose.yml และ serve.json ตามข้างบน
  3. สร้างไฟล์ชื่อ .env มีหนึ่งบรรทัด: TS_AUTHKEY= ตามด้วยกุญแจของคุณ
  4. รัน docker compose up -d
  5. ตรวจ: myapp ปรากฏใน tailscale status เปิด https://myapp. + ชื่อ tailnet + .ts.net จะเห็นหน้าต้อนรับของ nginx
  6. เก็บกวาด: docker compose down -v แล้วลบ myapp ในหน้าผู้ดูแล
  1. 创建 auth key:管理后台 → Settings → Keys,复制下来。
  2. 在新文件夹里按上面的内容创建 docker-compose.ymlserve.json
  3. 创建一个叫 .env 的文件,写一行:TS_AUTHKEY= 加上你的密钥。
  4. 运行 docker compose up -d
  5. 检查:tailscale status 里出现 myapp。打开 https://myapp. + 你的 tailnet 名 + .ts.net,能看到 nginx 欢迎页。
  6. 收尾:docker compose down -v,然后在管理后台删除 myapp

8 🩺 When it does not work · เมื่อใช้งานไม่ได้ · 用不了的时候

ProblemTry this · ลองทำแบบนี้ · 试试这样
A device shows offlineอุปกรณ์ขึ้น offline设备显示 offlineIs it on, with internet? Is Tailscale running and logged in? Did its key expire? The Machines page shows Expired.เครื่องเปิดอยู่และมีอินเทอร์เน็ตไหม Tailscale รันและล็อกอินอยู่ไหม กุญแจหมดอายุหรือเปล่า หน้า Machines จะขึ้น Expired设备开着并且有网吗?Tailscale 在运行并已登录吗?密钥过期了吗?Machines 页面会显示 Expired
tailscale ping works, but the app does nottailscale ping ใช้ได้ แต่แอปใช้ไม่ได้tailscale ping 能通,但应用打不开The network is fine. Check the other device's firewall. Check that the app listens on the network, not only on 127.0.0.1. Then check your access rules.เครือข่ายปกติดี ตรวจไฟร์วอลล์ของอีกเครื่อง ตรวจว่าแอปรอรับจากเครือข่าย ไม่ใช่แค่ 127.0.0.1 แล้วตรวจกฎการเข้าถึง网络没问题。检查另一台设备的防火墙,确认应用监听的是网络而不只是 127.0.0.1,再检查访问规则。
It works, but slowly: relayใช้ได้แต่ช้า: relay能用但很慢:relayYour network blocks direct UDP. Run tailscale netcheck. At home, turn on UPnP or NAT-PMP on the router. Outbound UDP 41641 and 3478 help.เครือข่ายของคุณบล็อก UDP แบบตรง รัน tailscale netcheck ที่บ้านให้เปิด UPnP หรือ NAT-PMP ที่เราเตอร์ การเปิด UDP ขาออก 41641 และ 3478 ช่วยได้你的网络挡住了直连 UDP。运行 tailscale netcheck。在家可以在路由器上打开 UPnP 或 NAT-PMP,放行出站 UDP 41641 和 3478 也有帮助。
Nothing answers, even by nameไม่มีอะไรตอบเลย แม้ใช้ชื่อ什么都不响应,用名字也不行Are both devices really in the same tailnet? A second Google account makes a second tailnet. Compare the Machines page on both.ทั้งสองเครื่องอยู่ใน tailnet เดียวกันจริงไหม บัญชี Google อีกบัญชีหนึ่งจะสร้าง tailnet อีกอันหนึ่ง เปรียบเทียบหน้า Machines ของทั้งสองบัญชี两台设备真的在同一个 tailnet 里吗?换一个 Google 账号就是另一个 tailnet。对比一下两边的 Machines 页面。
Websites stop loading after joiningเข้าร่วมแล้วเว็บโหลดไม่ขึ้น加入后网页打不开A DNS conflict, often on Linux. Try sudo tailscale set --accept-dns=false. Also check your exit node. Is it offline?DNS ชนกัน มักเกิดบน Linux ลอง sudo tailscale set --accept-dns=false และตรวจว่ายังใช้ exit node ที่ออฟไลน์อยู่หรือเปล่าDNS 冲突,常见于 Linux。试试 sudo tailscale set --accept-dns=false,也检查一下是不是还在用一个已经离线的出口节点。
Another VPN is also onเปิด VPN ตัวอื่นอยู่ด้วย同时开着别的 VPNPhones allow only one VPN at a time. On computers, two VPNs can block each other. Turn one off to test.โทรศัพท์ใช้ VPN ได้ทีละตัว บนคอมพิวเตอร์ VPN สองตัวอาจบล็อกกัน ปิดตัวหนึ่งเพื่อทดสอบ手机一次只能开一个 VPN。电脑上两个 VPN 可能互相干扰,关掉一个测试一下。

9 🧹 Remove a device, or leave · ลบอุปกรณ์ หรือเลิกใช้ · 移除设备或退出

🇬🇧 English

Uninstalling the app does not remove the device from your tailnet. Did you lose or sell a laptop? Remove it in the admin console. Go to Machines → the device's menu → Remove. It loses access at once. Also turn on device approval. Without it, a removed device can log in again.

To pause Tailscale on a device, use tailscale down. tailscale up starts it again. To sign the device out completely, use tailscale logout.

🇹🇭 ไทย

การถอนแอปไม่ได้ลบอุปกรณ์ออกจาก tailnet ถ้าแล็ปท็อปหายหรือขายไปแล้ว ให้ลบในหน้าผู้ดูแล: Machines → เมนูของเครื่อง → Remove มันจะเสียสิทธิ์ทันที เปิด device approval ไว้ด้วย ไม่อย่างนั้นเครื่องที่ถูกลบจะล็อกอินกลับเข้ามาใหม่ได้ง่าย ๆ

ถ้าอยากพัก Tailscale บนเครื่องหนึ่ง ใช้ tailscale down และ tailscale up เพื่อเปิดอีกครั้ง ถ้าต้องการออกจากระบบทั้งหมด ใช้ tailscale logout

🇨🇳 中文

卸载应用并不会把设备从 tailnet 里移除。笔记本丢了或卖了,要在管理后台移除:Machines → 设备菜单 → Remove,它会立刻失去访问权限。同时打开设备审批,否则被移除的设备可以直接重新登录。

想暂停某台设备上的 Tailscale,用 tailscale downtailscale up 重新开启。要彻底退出登录,用 tailscale logout

⌨️ TERMINAL · on the device

tailscale down
tailscale up
tailscale logout

🇬🇧 English

Next: Linux Lab teaches the terminal skills for this page. Try Docker Lab before section 7.

🇹🇭 ไทย

ต่อไป: Linux Lab สำหรับทักษะ terminal ที่หน้านี้ใช้ และ Docker Lab ก่อนลองรัน sidecar ในหัวข้อ 7

🇨🇳 中文

接下来:Linux Lab 学这一页用到的终端技能;运行第 7 节的 sidecar 之前,先看 Docker Lab