You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/blog/tailscale-router-ddev-addon.md
+50-18Lines changed: 50 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,8 @@
1
1
---
2
2
title: "Tailscale for DDEV: Simple and Secure Project Sharing"
3
3
pubDate: 2025-09-09
4
-
modifiedDate: 2025-10-09
4
+
modifiedDate: 2025-10-20
5
+
modifiedComment: "Updated for v3.0.0!"
5
6
summary: "Tired of temporary sharing links? Learn how to use the ddev-tailscale-router add-on to get a stable, secure, and private URL for your DDEV projects."
6
7
author: Ajith Thampi Joseph
7
8
featureImage:
@@ -14,9 +15,9 @@ categories:
14
15
- TechNotes
15
16
---
16
17
17
-
I've found that DDEV's [`ddev share`](https://docs.ddev.com/en/stable/users/topics/sharing/) command is a great way to quickly share my local development environment. However, since it uses ngrok, it generates a new, random URL every time unless you use a [stable domain](https://docs.ddev.com/en/stable/users/topics/sharing/#setting-up-a-stable-ngrok-domain). As an alternative, I've created the [`ddev-tailscale-router`](https://github.com/atj4me/ddev-tailscale-router) add-on.
18
+
I've found that DDEV's [`ddev share`](https://docs.ddev.com/en/stable/users/topics/sharing/) command is a great way to quickly share my local development environment. However, since it uses ngrok, it requires ngrok to be installed on the host system and generates a new, random URL every time unless you use a [stable domain](https://docs.ddev.com/en/stable/users/topics/sharing/#setting-up-a-stable-ngrok-domain). As an alternative, I've created the [`ddev-tailscale-router`](https://github.com/atj4me/ddev-tailscale-router) add-on.
18
19
19
-
This add-on uses [Tailscale](https://tailscale.com/), a VPN service that creates a private and secure network between your devices. It is free for personal use!
20
+
This add-on uses [Tailscale](https://tailscale.com/), a VPN service that creates a private and secure network between your devices. It is free for personal use and doesn't require any additional software to be installed on your host system!
20
21
21
22
As a result, you get a stable, human-readable URL for each of your DDEV projects, which you can access from any device on your Tailscale network.
22
23
@@ -28,7 +29,9 @@ I've found this approach to be particularly useful for:
28
29
29
30
### How it Works
30
31
31
-
The `ddev-tailscale-router` add-on works by running a Tailscale container alongside your DDEV project. This container automatically connects to your Tailscale network and securely proxies requests to your project's web container.
32
+
The `ddev-tailscale-router` add-on works by installing Tailscale directly into your DDEV project's web container using userspace networking. This approach provides better macOS compatibility and improved reliability compared to running a separate container. The add-on automatically connects to your Tailscale network and securely proxies requests to your project.
33
+
34
+
> **Update:** Version 3.0.0 brought significant architectural improvements! The add-on now uses YAML-based configuration, improved command structure, and better error handling. If you're upgrading from an earlier version, see the [migration instructions](https://github.com/atj4me/ddev-tailscale-router/releases/tag/v3.0.0) in the release notes.
32
35
33
36
### Prerequisites
34
37
@@ -52,11 +55,7 @@ To get started, follow these steps:
52
55
53
56
Replace `~/.bashrc` with `~/.zshrc`if you use Zsh, or your relevant shell configuration file.
54
57
55
-
Alternatively, you can set it per project (**NOT RECOMMENDED**, because `.ddev/.env.tailscale-router` is not intended to store secrets):
56
-
57
-
```bash
58
-
ddev dotenv set .ddev/.env.tailscale-router --ts-authkey=tskey-auth-your-key-here
59
-
```
58
+
Alternatively, you can use interactive authentication after installation by running `ddev tailscale login` after your project starts.
60
59
61
60
2. Next, **install the add-on:**
62
61
@@ -71,7 +70,13 @@ To get started, follow these steps:
71
70
72
71
### Using Your Tailscale URL
73
72
74
-
Once installation is complete, you can access your project using these commands:
73
+
Once installation is complete, you need to start sharing your project:
74
+
75
+
Start sharing your project:
76
+
77
+
```bash
78
+
ddev tailscale share
79
+
```
75
80
76
81
Launch your project's Tailscale URL in browser:
77
82
@@ -87,6 +92,8 @@ ddev tailscale url
87
92
88
93
Your project's permanent Tailscale URL will look like: `https://<project-name>.<your-tailnet>.ts.net`. You can also find it in your Tailscale admin console.
89
94
95
+
To see all available commands and options, run `ddev tailscale help`. This will show you both the DDEV-specific shortcuts and all native Tailscale CLI commands that you can use.
96
+
90
97
### Public vs. Private Mode
91
98
92
99
The add-on offers two modes for sharing your project:
@@ -96,23 +103,46 @@ The add-on offers two modes for sharing your project:
96
103
97
104
To switch between modes:
98
105
99
-
Switch to public mode (accessible to anyone on the internet):
106
+
Share publicly (accessible to anyone on the internet):
107
+
108
+
```bash
109
+
ddev tailscale share --public
110
+
```
111
+
112
+
Share privately (default, only accessible to your Tailscale devices):
100
113
101
114
```bash
102
-
ddev dotenv set .ddev/.env.tailscale-router --ts-privacy=public
103
-
ddev restart
115
+
ddev tailscale share
104
116
```
105
117
106
-
Switch back to private mode (default):
118
+
Stop sharing:
107
119
108
120
```bash
109
-
ddev dotenv set .ddev/.env.tailscale-router --ts-privacy=private
110
-
ddev restart
121
+
ddev tailscale stop
111
122
```
112
123
113
124
> **Note:** For public access, you need to configure your [Access Control List (ACL)](https://tailscale.com/kb/1223/funnel#funnel-node-attribute) to enable Funnel. See the [Tailscale Funnel documentation](https://tailscale.com/kb/1223/funnel) for details on setting up the required ACL policy.
114
125
115
-
I hope this add-on helps streamline your development workflow! If you run into any issues or have suggestions for improvements, feel free to open an issue on the [GitHub repository](https://github.com/atj4me/ddev-tailscale-router/issues).
126
+
### Uninstalling the Add-on
127
+
128
+
If you need to remove the add-on from your project:
129
+
130
+
1. **Stop any active sharing:**
131
+
132
+
```bash
133
+
ddev tailscale stop
134
+
```
135
+
136
+
2. **Remove the add-on:**
137
+
138
+
```bash
139
+
ddev add-on remove tailscale-router
140
+
```
141
+
142
+
3. **Restart DDEV:**
143
+
```bash
144
+
ddev restart
145
+
```
116
146
117
147
### Additional Resources
118
148
@@ -129,6 +159,8 @@ Here are some additional resources that you might find helpful:
129
159
- **Medium: [My Journey with PHP Dev Environments](https://medium.com/@josephajithampi/my-journey-with-php-dev-environments-1da9f2806ee9)**: A blog post on setting up a PHP development environment.
130
160
- **LinkedIn: [The Day My Development Environment Nearly Broke Me](https://www.linkedin.com/pulse/day-my-development-environment-nearly-broke-me-how-i-thampi-joseph-ildhc/)**: An article on the importance of a reliable development environment.
131
161
162
+
I hope this add-on helps streamline your development workflow! If you run into any issues or have suggestions for improvements, feel free to open an issue on the [GitHub repository](https://github.com/atj4me/ddev-tailscale-router/issues).
163
+
132
164
---
133
165
134
-
_This blog post was written with the assistance of Amazon Q and Google Gemini. I used them to help simplify the language, improve the flow, and proofread the text._
166
+
_This blog post was updated with the assistance of GitHub Copilot (Claude). I used it to help update the content based on the latest add-on changes, improve accuracy, and maintain consistency. The original version was written with assistance from Amazon Q and Google Gemini._
0 commit comments