> 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
