← Guides

How to get a static outbound IP on Heroku

Standard Heroku dynos run in a shared, multi-tenant network with no documented fixed outbound IP. When a database or partner API needs one, you have three realistic options. Here is how they compare and how to set each one up.

Updated 2026-11-23 · 7 min read

Why Heroku dynos have no fixed IP

Apps on the Common Runtime share one multi-tenant network per region. Heroku does not publish a fixed outbound address for these dynos, so you cannot reliably allowlist them. Apps in a Private Space use a stable set of outbound IPs.

Check first that the IP rule is really what blocks you: ask the database or API owner for the rejected connection in their firewall log.

Your options

Option 1: find your Private Space outbound IPs

  1. In the Dashboard, open the space and its Network tab, or use the CLI:
    heroku spaces:info --space my-space-name
    You should see: a line starting with Outbound IPs: listing the addresses.
  2. Allowlist every address shown. All team members can view them; only team administrators can change the space.

Use your own static IP from a Common Runtime dyno

Request route through your static IP Heroku dyno 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 heroku and click Add.
    MazeVPN client area: Add a proxy user, with the name heroku typed in
    You should see: a new card named app-heroku. 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-heroku:…@203.0.113.42:443, where the address is your server’s IP.
  3. In the Heroku Dashboard, open the app and click the Settings tab.
    Heroku app page with the Settings tab highlighted
  4. In the Config Vars section, click Reveal Config Vars.
    Heroku Settings: Config Vars section with the Reveal Config Vars button highlighted
  5. Enter MAZE_PROXY_URL as the Key, paste the URL as the Value and click Add. Heroku restarts the app and creates a new release whenever a config var changes.
    Heroku Config Vars: key MAZE_PROXY_URL, an example value and the Add button
    You should see: the variable in the list and a new release under Activity.
  6. Or do the same with the Heroku CLI:
    heroku config:set MAZE_PROXY_URL='https://app-heroku:PASSWORD@203.0.113.42:443' --app my-app
  7. Pass the proxy only to the calls that reach the allowlisted service. In Python with requests (tested with requests 2.34 through a real MazeVPN HTTPS proxy):
    import os, requests
    
    PROXY = os.environ["MAZE_PROXY_URL"]
    
    def partner_orders():
        r = requests.get(
            "https://api.example.com/v1/orders",
            proxies={"http": PROXY, "https": PROXY},
            timeout=10,
        )
        r.raise_for_status()
        return r.json()

Test it, then update the allowlist

  1. Start a one-off dyno and check the IP through the proxy:
    heroku run bash --app my-app
    curl -s --proxy "$MAZE_PROXY_URL" https://ifconfig.me/ip; echo
    You should see: your server’s IP.
  2. Make one real read-only request to the partner. Also test worker and scheduler dynos that call the same service, then remove the old 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.

Do Heroku dynos have a static IP? +

Common Runtime dynos have no documented fixed outbound IP. Apps in a Private Space use a stable set of outbound IPs dedicated to the space.

Does a proxy cover database connections? +

An HTTP proxy only covers HTTP requests sent through it. For a native database connection you need a driver with SOCKS5 support, a Private Space, or another network-level option.

Will the proxy slow my app down? +

Proxied requests take an extra hop. Pick a proxy city near your Heroku region and the partner, then measure from a dyno.

What does a MazeVPN dedicated IP cost? +

Solo is $9.99 a month with one dedicated IPv4 and three proxy users, with no request quota. See the pricing page.

More guides