# How to Migrate from an Existing  NGINX Proxy Manager Deployment and Keep Configuration

To migrate from an existing NGINX Proxy Manager installation to a version which provides also open-appsec integration here's some guidance:

{% hint style="info" %}
This is only relevant if you want to keep your existing NGINX Proxy Manager configuration,\
otherwise it is suggested to start fresh with the deployment instructions shown on these pages:

[deploy-nginx-proxy-manager-with-open-appsec-managed-from-npm-webui](https://docs.openappsec.io/integrations/nginx-proxy-manager/deploy-nginx-proxy-manager-with-open-appsec-managed-from-npm-webui "mention")\
[deploy-nginx-proxy-manager-with-open-appsec-managed-from-central-webui-saas](https://docs.openappsec.io/integrations/nginx-proxy-manager/deploy-nginx-proxy-manager-with-open-appsec-managed-from-central-webui-saas "mention")
{% endhint %}

{% hint style="warning" %}
Note that the specific steps can vary based on customizations that you might have done to the original NGINX Proxy Manager's docker compose file.

The below is assuming you did a deployment by using the default docker-compose.yml file similarly as shown here: <https://nginxproxymanager.com/setup/#running-the-app> .
{% endhint %}

* Change into your existing folder that contains the docker-compose.yml file and all related files and folders for your current NGINX Proxy Manager deployment.
* Stop your current deployment with `docker-compose down` in the folder that contains your `docker-compose.yaml` file used for the NGINX Proxy Manager deployment.
* Make a full backup of your existing folder that contains the NGINX Proxy Manager docker compose environment, including any mounted volumes like `./data` and `./letsencrypt`, etc. to a safe location. This will allow you to bring it up with `docker-compose up` later exactly as it was before the migration, if required for some reason.
* Rename the original `docker-compose.yml`  file (so you will still have it as a backup):

```bash
mv ./docker-compose.yml ./docker-compose.npm.orig.yml
```

{% tabs %}
{% tab title="open-appsec managed from NPM WebUI" %}

### **Please carefully read the important considerations below!**

Only then follow the regular instructions for the deployment:

{% content-ref url="deploy-nginx-proxy-manager-with-open-appsec-managed-from-npm-webui" %}
[deploy-nginx-proxy-manager-with-open-appsec-managed-from-npm-webui](https://docs.openappsec.io/integrations/nginx-proxy-manager/deploy-nginx-proxy-manager-with-open-appsec-managed-from-npm-webui)
{% endcontent-ref %}

### **Important considerations:**

* Your existing NGINX Proxy Manager (and Let's Encrypt) configuration will still be available also once migrated to the open-appsec enhanced NGINX Proxy Manager deployment as long as it still resides in the local `./data` and `./letssencrypt` folders.
* If you did any important changes to the original `docker-compose.yml` file from the NGINX Proxy Manager project:\
  Once you downloaded the `docker-compose.yaml` file for deployment of NGINX Proxy Manager with open-appsec, make sure to apply these changes also to this `docker-compose.yaml` file.\
  You can compare the new `docker-compose.yaml` with the renamed `docker-compose.orig.yaml` file of you previous deployment of only NGINX Proxy Manager. Note that for the open-appsec integration a combination of a  `docker-compose.yaml` file with a **.env** file is being used, as this allows for easier customization of commonly used variables.
* Below find the relevant folders typically containing the persistent configuration of NGINX Proxy (NPM) Manager, they will also be mounted as part of the open-appsec NPM integration `docker-compose.yaml` so that all your existing configuration should be kept. \
  \
  Only if for some reason you changed the local folder locations for these specific docker volume mounts in the past, please make sure to adjust those as well in the new `.env` file for the open-appsec NGINX Proxy Manager integration.

  ```bash
  NPM_DATA=./data
  NPM_LETSENCRYPT=./letsencrypt
  ```
* When you perform the first time login with your web browser to the Web UI of the NGINX Proxy Manager (NPM) with open-appsec integration then your existing user credentials for the login should still work, indicating your NPM configuration was kept successfully.

```http
http://[hostname or IP of your host]:81
```

* After switching to and loading the new Nginx Proxy Manager (NPM) pages, make sure to clear your browser’s cache and cookies to ensure the updated configuration is applied correctly.
  {% endtab %}

{% tab title="open-appsec managed from central WebUI" %}

### **Please carefully read the important considerations below!**

Only then follow the regular instructions for the deployment:

{% content-ref url="deploy-nginx-proxy-manager-with-open-appsec-managed-from-central-webui-saas" %}
[deploy-nginx-proxy-manager-with-open-appsec-managed-from-central-webui-saas](https://docs.openappsec.io/integrations/nginx-proxy-manager/deploy-nginx-proxy-manager-with-open-appsec-managed-from-central-webui-saas)
{% endcontent-ref %}

### **Important considerations:**

* Your existing NGINX Proxy Manager (and Let's Encrypt) configuration will still be available also once migrated to the open-appsec enhanced NGINX Proxy Manager deployment as long as it still resides in the local `./data` and `./letssencrypt` folders.
* If you did any important changes to the original `docker-compose.yml` file from the NGINX Proxy Manager project:\
  Once you downloaded the `docker-compose.yaml` file for deployment of NGINX Proxy Manager with open-appsec, make sure to apply these changes also to this `docker-compose.yaml` file.\
  You can compare the new `docker-compose.yaml` with the renamed `docker-compose.orig.yaml` file of you previous deployment of only NGINX Proxy Manager. Note that for the open-appsec integration a combination of a  `docker-compose.yaml` file with a **.env** file is being used, as this allows for easier customization of commonly used variables.
* Below find the relevant folders typically containing the persistent configuration of NGINX Proxy (NPM) Manager, they will also be mounted as part of the open-appsec NPM integration `docker-compose.yaml` so that all your existing configuration should be kept. \
  \
  Only if for some reason you changed the local folder locations for these specific docker volume mounts in the past, please make sure to adjust those as well in the new `.env` file for the open-appsec NGINX Proxy Manager integration.

  ```
  NPM_DATA=./data
  NPM_LETSENCRYPT=./letsencrypt
  ```
* When you perform the first time login with your web browser to the Web UI of the NGINX Proxy Manager (NPM) with open-appsec integration then your existing user credentials for the login should still work, indicating your NPM configuration was kept successfully.

```http
http://[hostname or IP of your host]:81
```

* After switching to and loading the new Nginx Proxy Manager (NPM) pages, make sure to clear your browser’s cache and cookies to ensure the updated configuration is applied correctly.
  {% endtab %}
  {% endtabs %}


---

# Agent Instructions: 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:

```
GET https://docs.openappsec.io/integrations/nginx-proxy-manager/how-to-migrate-from-an-existing-nginx-proxy-manager-deployment-and-keep-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
