← Guides

How to get a static egress IP on Fly.io

Fly Machines do not have a fixed outbound IP by default, so an IP allowlist breaks as soon as a Machine moves or restarts. Fly sells static egress IPs per app and region. Here is how to set them up, step by step, and what to watch for.

Updated 2026-11-23 · 7 min read

Why the IP keeps changing

Fly rewrites the source address of a Machine’s outbound IPv4 traffic on the host it runs on. Restart or move the Machine and the address can change; Fly calls these default egress IPs unstable.

Second trap: if the destination has an IPv6 address, your Machine often connects over IPv6. A firewall that only lists your IPv4 then rejects you.

Option 1: Fly static egress IPs

  1. Allocate a static egress pair for the app in each region it runs in (here Frankfurt). Output from our run, addresses replaced with examples:
    $ fly ips allocate-egress --app my-app -r fra
    Allocated egress IPs for region fra:
    203.0.113.42
    2001:db8:42::1
    Newly-allocated egress IPs may need 5 - 10 minutes to take effect on existing machines.
    You should see: one IPv4 and one IPv6 address for that region.
  2. List the app’s addresses and send every egress address to the partner, IPv4 and IPv6:
    $ fly ips list --app my-app
     VERSION │ IP              │ TYPE   │ REGION
     v4      │ 203.0.113.42    │ egress │ fra
     v6      │ 2001:db8:42::1  │ egress │ fra
  3. Wait a short moment: new pairs reach existing Machines after a delay, and new Machines may need a moment too, especially during blue-green deploys.
Static egress is a Pay As You Go feature. In November 2026 flyctl refused it on the free starter credit (“Add a credit card to use this feature”) and on the Free plan (“Static egress IPv4 addresses aren’t included in the Free plan”). After switching to Pay As You Go it worked, and a new Machine in that region used the egress IPv4 and IPv6 for its outbound requests.

How static egress IPs behave

Option 2: a dedicated-IP proxy for selected requests

If only one partner API needs a fixed address, leave Fly’s networking alone and send just those requests through your own server. That also gives you one address across several apps, regions and hosting platforms.

Request route through your static IP Fly Machine your code proxy (HTTPS) Your server 203.0.113.42 from 203.0.113.42 Partner API / DB allows 203.0.113.42
Only the calls you send through the proxy use your static IP. Every other request goes out directly, as before.
  1. Log in to the client area, open My Services and click your server. Scroll to Use your IP from code, n8n, CI or a browser. Under Add a proxy user, type fly and click Add.
    MazeVPN client area: Add a proxy user, with the name fly typed in
    You should see: a new card named app-fly. Names can use letters and digits only, and MazeVPN adds the app- prefix.
  2. On that card, click Copy next to HTTPS proxy (marked Encrypted). The copied URL contains the password, so paste it only into a secret or environment variable, never into code.
    MazeVPN client area: the card of proxy user app-ci with its HTTPS, HTTP and SOCKS5 proxy URLs and Copy buttons
    The card of a new proxy user. The eye icon shows the password; Copy copies the full URL with the password. (Server IP replaced with an example.)
    You should see: a URL like https://app-fly:…@203.0.113.42:443, where the address is your server’s IP.
  3. Store the URL as a secret. Quote it so the shell does not touch special characters. By default flyctl deploys the new secret to your Machines; add --stage to set it without deploying.
    fly secrets set MAZE_PROXY_URL='https://app-fly:PASSWORD@203.0.113.42:443' --app my-app
  4. In Node.js, pass a proxy dispatcher only to the calls that need the fixed IP; the helper is in the Vercel guide. In Python with requests, see the Heroku guide.

A real test run (November 2026)

We ran this on a new Fly app in Frankfurt with a MazeVPN test server. The secret was set with --stage, which still reaches Machines created afterwards. The Machine printed its normal address first and the static IP through the proxy (addresses replaced with examples):

fly machine run curlimages/curl:latest --app my-app --region fra --restart no \
  --entrypoint /bin/sh -- -c 'echo direct=$(curl -s https://ifconfig.me/ip); \
  echo proxy=$(curl -s --proxy "$MAZE_PROXY_URL" https://ifconfig.me/ip)'
fly logs --app my-app --no-tail

# output
direct=198.51.100.23   # Fly's shared egress, changes
proxy=203.0.113.42     # your static IP

Test from a running Machine

  1. Open a shell on a Machine with fly ssh console --app my-app. If curl is installed in your image, run the check:
    # static egress: direct call
    curl -s https://ifconfig.me/ip; echo
    # proxy: through your server
    curl -s --proxy "$MAZE_PROXY_URL" https://ifconfig.me/ip; echo
    You should see: an address from fly ips list for static egress, or your server’s IP for the proxy.
  2. If the destination supports IPv6, also check curl -6 -s https://ifconfig.me/ip and make sure that address is allowlisted, or force IPv4 in your client.
  3. Make one real read-only request to the partner from every region you run in, then remove old allowlist entries.

Official references

Skip the setup

A dedicated IPv4 in 38 cities, usually ready about 3 minutes after payment. Connect devices with WireGuard and apps with an authenticated HTTPS, HTTP, or SOCKS5 proxy. From $9.99/month.

FAQ

Questions, answered.

Something else? Open a ticket, a human replies.

Is a Fly static egress IP only for my app? +

It is allocated to your app in one region and stays yours until you release it. All your Machines in that region use it.

Do I have to allowlist the IPv6 address too? +

If the destination has an IPv6 address, your Machines may connect over IPv6. Allowlist both addresses of the pair, or make sure your client uses IPv4.

What happens when I deploy? +

App-scoped static egress IPs survive deploys and Machine replacement. New Machines may need a short moment before they use them.

What does a MazeVPN dedicated IP cost? +

Solo is $9.99 a month with one dedicated IPv4 and three proxy users, usable from any platform. See the pricing page.

More guides