> For the complete documentation index, see [llms.txt](https://docs.umbraco.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.umbraco.com/umbraco-cms/run-in-production/security/lock-access-to-umbraco-folder.md).

# Lock Down Access to the Umbraco Folder (IIS)

Learn how to restrict access to the /umbraco/ folder by allowlisting IP addresses using IIS URL Rewrite rules.

This article explains how to lock down the `/umbraco/` folder to specific IP addresses using IIS URL Rewrite. Use this approach to prevent the Umbraco backoffice from being accessible to everyone on the internet.

To follow these steps, you must have [IIS URL Rewrite](/umbraco-cms/develop-with-umbraco/application-code/backend-and-custom-logic/routing/iisrewriterules.md) installed on your server.

Locking down `/umbraco/` will also block API and Surface controllers and the Delivery API. The steps below exclude these paths before restricting the rest.

1. Add the following rule to your `IISRewrite.config` to exclude paths that should remain publicly accessible:

```xml
<rule name="Ignore" stopProcessing="true">
    <match url="^(?:umbraco/api|umbraco/surface|umbraco/delivery)/" />
    <action type="None" />
</rule>
```

{% hint style="info" %}
Some packages and add-ons expose paths under `/umbraco/` that must also remain publicly accessible. For example, [Umbraco Engage requires `/umbraco/engage/*`](https://docs.umbraco.com/umbraco-engage/security-and-privacy/security-and-privacy#security-settings) to be excluded.

Check the documentation for any installed packages to identify paths that need to be added to the exclusion rule.
{% endhint %}

2. Note your allowed IP addresses as a pipe-separated regular expression. For example, `213.3.10.8` and `88.4.43.108` becomes `^(213\.3\.10\.8|88\.4\.43\.108)$`.
3. Add the following rule to your `IISRewrite.config` to block all other IP addresses:

```xml
<rule name="Allowed IPs" stopProcessing="true">
    <match url="^(?:umbraco)(?:/|$)" />
    <conditions>
        <add input="{REMOTE_ADDR}" negate="true" pattern="^(213\.3\.10\.8|88\.4\.43\.108)$" />
    </conditions>
    <action type="AbortRequest" />
</rule>
```

{% hint style="info" %}
If your server is behind a load balancer, you should use `{HTTP_X_FORWARDED_FOR}` instead of `{REMOTE_ADDR}` as the input for the rule.
{% endhint %}

If you now go to `/umbraco/` from a different IP-address the login screen will not be rendered.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.umbraco.com/umbraco-cms/run-in-production/security/lock-access-to-umbraco-folder.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
