Connect your sprite to your Fly.io organization private network easily!
Warning: This guide assumes you have flyctl (install from fly.io) and sprite (install from sprites.dev) commands installed and authenticated.
Step 1: Create WireGuard peer config
$ fly wg create
? Select Organization: Your Organization (your-organization)
Creating WireGuard peer "PEER ID" in region "jnb" for organization your-organization
!!!! WARNING: Output includes private key. Private keys cannot be recovered !!!!
!!!! after creating the peer; if you lose the key, you'll need to remove !!!!
!!!! and re-add the peering connection. !!!!
? Filename to store WireGuard configuration in, or 'stdout': peer-config
Step 2: Connect your sprite
Note: The peer-config file must be in the same folder where you execute this command and must be named exactly peer-config.
bash <(curl -s https://lubien.dev/sprites/connect-wireguard) [Your Sprite Name]
Step 3: You’re done!
Log into your sprite and test the connection:
$ sprite console -s [Your sprite name]
$ dig TXT _apps.internal
;; Truncated, retrying in TCP mode.
; <<>> DiG 9.20.11-0ubuntu0.2-Ubuntu <<>> TXT _apps.internal
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52901
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;_apps.internal. IN TXT
;; ANSWER SECTION:
_apps.internal. 10 IN TXT "app-name-1,...others" "app-name-2,...others" "..." "..." "..." "..."
;; Query time: 275 msec
;; SERVER: fdaa:a:6665::3#53(fdaa:a:6665::3) (TCP)
;; WHEN: Tue Mar 03 16:55:38 UTC 2026
;; MSG SIZE rcvd: 1635
Your sprite is now connected to your Fly.io private network!