Allow only some IP addresses to reach an app
You may want an app to open only from your home network, or only from your home network and a VPN. This page shows two ways to do that. Start with the built-in way. Use the IP allowlist when you need finer control.
Before you start
Section titled “Before you start”- Traefik Production is done and Traefik is running. See the Quick start if it is not.
- The app has a file named
app-NAME.ymlinappdata/traefik3/rules/HOSTNAME/inside your Docker folder.NAMEis the app name andHOSTNAMEis your server’s hostname. Deployrr creates this file when you install an app while Traefik is running, or when you use Traefikify. - You can edit files in your Docker folder with a text editor.
- For Option 1: Setup Mode is Hybrid, Proxy Type is Traefik, and you have a Plus or Pro license. Manage Exposure needs all three.
Option 1: Use Internal exposure (built in)
Section titled “Option 1: Use Internal exposure (built in)”This is the simplest way. An app set to Internal answers only on your local network. Traefik does not publish it to the internet side at all.
- In Deployrr, go to Proxy > Traefik > Traefik Mode.
- Look at the Traefik Mode line. It shows the current mode. If it says Simple, select Traefik Mode once to switch to Advanced. If it already says Advanced, don’t select it, or it switches back to Simple. In Simple mode every app is exposed both internally and externally, and you can’t change that per app. See Simple vs Advanced Traefik mode for what changes when you switch.
- On your router, forward port 80 to port 81 on your server. Forward port 443 to port 444. These are the only ports the internet side needs. A VPS usually has no router to do this; see Fix the UFW firewall on a VPS before you try Advanced mode there.
- Make sure devices at home reach the server directly. Either your router supports hairpinning, or you use local DNS rewrites (in your router, Pi-hole or AdGuard Home) that point your app names at the server’s local IP address. Without one of these, home traffic may count as external, and Internal apps don’t open by name.
- Go to Proxy > Traefik > Manage Exposure.
- Select the app and choose Change.
- In the Change Exposure box, choose Internal and select Apply. The options are Both, Internal and External. The change takes effect right away.
To see Manage Exposure in use, and why hairpinning or local DNS matters, watch Deployrr 5 walkthrough: Manage App Exposure at 1:08:47 (shows Deployrr v5; menus differ in v6).
Internal works by which ports reach the server, not by checking who connects. If your router forwards ports 80 and 443 straight to the server instead of to 81 and 444, outside visitors can still reach Internal apps.
If this covers what you need, stop here.
Option 2: Use an IP allowlist (manual)
Section titled “Option 2: Use an IP allowlist (manual)”Use this when Internal exposure is too blunt. For example, you want to allow your LAN and a VPN range, or the app must stay on Both but only some addresses may open it.
If you want to block whole countries instead of listing address ranges, read UDMS part 25: Why you need Geoblock (manual setup, background only).
Find your LAN range
Section titled “Find your LAN range”-
On the server, run this command:
Terminal window ip -4 route -
Look for a line that ends in
scope link. It starts with a range such as192.168.1.0/24. That is your LAN range. -
Write it down. If you use a VPN, find its address range in the VPN’s settings and write that down too.
Private ranges you may see are 192.168.0.0/16, 10.0.0.0/8 and 172.16.0.0/12. Use the smallest range that covers your devices.
Create the allowlist
Section titled “Create the allowlist”-
In
appdata/traefik3/rules/HOSTNAME/, create a file namedmiddlewares-ipallowlist.yml. -
Put this in it. Replace the example ranges with your own.
http:middlewares:middlewares-ipallowlist:ipAllowList:sourceRange:- "127.0.0.1/32" # This server- "192.168.1.0/24" # Your LAN range- "10.8.0.0/24" # Your VPN range, if you have one -
Save the file.
Deployrr does not ship an allowlist file, so you create this one yourself.
Create a chain that uses it
Section titled “Create a chain that uses it”The shipped chain-no-auth file has rate limiting and secure headers. Make a copy of it with the allowlist added.
To see how a chain groups middlewares, watch Traefik 3 guide: middleware chains at 14:44 (manual Docker Compose setup; its folder names differ from Deployrr v6).
-
In the same folder, create a file named
chain-no-auth-internal-only.yml. -
Put this in it:
http:middlewares:chain-no-auth-internal-only:chain:middlewares:- middlewares-ipallowlist- middlewares-rate-limit- middlewares-secure-headers -
Save the file.
If the app uses a login chain such as Authelia, you can add - middlewares-ipallowlist to a chain of your own instead. Don’t edit the chain files Deployrr ships. Make a copy with a new name.
Use the chain in the app
Section titled “Use the chain in the app”-
Open
appdata/traefik3/rules/HOSTNAME/app-NAME.yml. -
Find the
middlewares:list under the app’s router. It looks like this:middlewares:- chain-no-authIf you picked a login method when you set up the app, you see a different chain name, such as
chain-authelia. Replace that name instead. -
Change the chain name to your new one. Don’t add
@file.middlewares:- chain-no-auth-internal-only -
Save the file. Traefik picks up changes in this folder on its own. You don’t need to restart it.
Apps that use Docker labels instead of a rules file are the exception. Traefik, Google OAuth, Authelia, TinyAuth and Authentik do this. For those, add @file to the chain name in the label, for example chain-no-auth-internal-only@file.
Keep Cloudflare on DNS only
Section titled “Keep Cloudflare on DNS only”The allowlist checks the address that connects to Traefik. That works only if nothing in front of Traefik hides the real address.
In Cloudflare, set your DNS records to DNS only (grey cloud). Deployrr’s domain checks (Prerequisites > Domain Checks) expect this. They report an error if the records are proxied (orange cloud). With the orange cloud, Traefik sees Cloudflare’s addresses and not your clients’.
Check it worked
Section titled “Check it worked”-
From a device inside an allowed range, open the app in a browser. It loads as normal.
-
From a device outside every allowed range, open the same address. A phone on mobile data, with Wi-Fi off, works well. You see
403 Forbidden. -
Or run this from a computer. Replace
SUBDOMAIN.YOUR_DOMAINwith your app’s address.Terminal window curl -s -o /dev/null -w "%{http_code}\n" https://SUBDOMAIN.YOUR_DOMAINAn allowed device prints the app’s normal code, such as
200. A blocked device prints403.
If an allowed device gets 403, check these:
- Your range is written correctly, such as
192.168.1.0/24, and covers the device’s address. - Your Cloudflare records are grey cloud.
- The file names and the names inside them match.
chain-no-auth-internal-onlyin the chain file is the same name you put inapp-NAME.yml.
Read the Traefik logs for errors about the middleware or chain.

