Skip to content

Commit 2ec9708

Browse files
committed
Add documentation for app-scoped egress IPs
1 parent 5d25915 commit 2ec9708

File tree

2 files changed

+59
-7
lines changed

2 files changed

+59
-7
lines changed

networking/egress-ips.html.md

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ date: 2025-10-02
99
## Overview
1010

1111
- By default, outbound (egress) IPs from Fly Machines are **unstable** and may change.
12-
- You can allocate **static egress IPs** per machine (both IPv4 and IPv6) via `fly machine egress-ip`.
13-
- Static egress IPs come with trade-offs: cost, binding to machine lifecycle, and deployment quirks.
14-
- A common workaround is to front outbound traffic through a **proxy** app that _does_ have static egress IPs.
15-
- App-scoped egress IPs are in development and may simplify this in the future.
12+
- You can allocate **static egress IPs** for an app (both IPv4 and IPv6) via `fly ips allocate-egress`.
13+
- App-scoped Static egress IPs are per-region: you need one for every region where you have machines.
14+
- Static egress IPs come with trade-offs: cost, concurrent machines / connections.
15+
- Legacy machine-scoped static egress IPs are still availble, but no longer recommended due to their limitations and quirks.
1616

1717
---
1818

@@ -26,8 +26,52 @@ Some external services—APIs, databases, payment providers—require allowlisti
2626

2727
---
2828

29+
## Static Egress IPs (App-Scoped)
30+
31+
App-scoped static egress IPs can be shared between multiple machines in a region belonging to the same app, and will not be deleted when machines are recreated. They are recommended over our legacy, machine-scoped static egress IPs.
32+
33+
### Allocate an App-scoped Static Egress IP
34+
35+
```bash
36+
fly ips allocate-egress --app <app-name> -r <region>
37+
```
38+
39+
This allocates a pair of static egress IPv4 and IPv6 for your app in a region.
40+
41+
If your app has Machines in multiple regions, you must allocate at least 1 app-scoped static egress IP address __per region__.
42+
Only machines located in the same region can use static egress IPs allocated in the region.
43+
44+
<div class="note icon">
45+
You can allocate multiple pairs of static egress IPv4 and IPv6 in the same region. Machines will randomly choose a pair from all static Egress IPs available in the region.
46+
</div>
47+
48+
### View and Manage
49+
50+
```bash
51+
fly ips list
52+
fly ips release-egress <ip-address>
53+
```
54+
55+
### Billing
56+
57+
Each app-scoped static egress IPv4 cost $3.60/mo, billed hourly. IPv6 is currently free, but must be allocated along with an IPv4.
58+
59+
### Caveats
60+
61+
- Each static egress IP can support up to 64 Machines. If you need more than 64 Machines in one region, you will need to allocate multiple static egress IPs.
62+
- When using App-scoped static egress IPs, a Machine can make up to 1000 connections to _each_ external IP address. There is no limit on the _total_ number of concurrent connections.
63+
- We do not expect this to be a concern for most apps. However, feel free to talk to us if this limits your use case!
64+
- When you have multiple static egress IPs assigned in one region, there is currently no way to specify exactly which IP each machine will use.
65+
- When new machines are created, there might be a brief window when an app-scoped egress IP is not applied to the machine. This may happen more often with more machines or during bluegreen deployment. Allocating multiple pairs of static egress IPs alleviates the issue.
66+
67+
---
68+
2969
## Static Egress IPs (Machine-Scoped)
3070

71+
<div class="warning icon">
72+
Machine-scoped static egress IPs are considered a legacy feature and may be removed in the future. This document section is kept for reference purposes only. New apps should use [app-scoped static egress IPs](#static-egress-ips-app-scoped).
73+
</div>
74+
3175
### Allocate a Static Egress IP
3276

3377
```bash
@@ -45,7 +89,7 @@ fly machine egress-ip release <machine-id> --app <app-name>
4589

4690
### Caveats
4791

48-
Static egress IPs are **per-machine**, not per-app.
92+
Because legacy static egress IPs are **per-machine**, not per-app:
4993

5094
- IPs are released when a machine is destroyed.
5195
- IPs don’t automatically transfer across deploys.
@@ -54,12 +98,16 @@ Static egress IPs are **per-machine**, not per-app.
5498
- Extra latency and connectivity issues are possible in some regions.
5599

56100
<div class="callout">
57-
Static egress IPs are billed per hour per machine.
101+
Machine-scoped static egress IPs are billed per hour per machine.
58102
</div>
59103

60104
---
61105

62-
## The Proxy Pattern
106+
## The Proxy Pattern (for Machine-Scoped Static Egress IPs)
107+
108+
<div class="warning icon">
109+
This section only applies to existing apps using machine-scoped static egress IPs. New apps should use [app-scoped static egress IPs](#static-egress-ips-app-scoped) instead.
110+
</div>
63111

64112
To avoid assigning static IPs to every machine, route traffic through a shared proxy app.
65113

networking/services.html.markerb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ Fly.io has public and private network services available. The public network ser
1212

1313
IPv6 addresses and shared IPv4 Anycast addresses are free. Dedicated IPv4 addresses are [billed](/docs/about/pricing/#anycast-ip-addresses) monthly.
1414

15+
<div class="note icon">
16+
Anycast IP addresses described on this page are __not used__ for outbound connections made from within a Machine. See [Egress IP Addresses](/docs/networking/egress-ips/) for details.
17+
</div>
18+
1519
### About Anycast
1620

1721
We announce global IP blocks from all of our datacenters over BGP, otherwise known as Anycast. Anycast is a core internet routing mechanism that connects clients to the "nearest" server advertising a block of IPs. You can read [all about it on Wikipedia](https://en.wikipedia.org/wiki/Anycast+external).

0 commit comments

Comments
 (0)