# Edit or duplicate a container

{% hint style="warning" %}
Editing a container effectively creates a new container with the updated settings and replaces the old container.
{% endhint %}

## Editing a running container

From the menu select **Containers**, select the container you want to edit then click **Duplicate/Edit**.

<figure><img src="/files/M9dsqK4zcuO3jDUAvaWj" alt=""><figcaption></figcaption></figure>

Make the required changes to the container configuration. When you're finished, click **Deploy the container**. When the confirmation message appears, click **Replace**.

<figure><img src="/files/eCq54c0TLRiPD4aEVLze" alt=""><figcaption></figcaption></figure>

If successful, a message will appear confirming that a new container has been created with the new settings, replacing the old container.

## Duplicating a running container

From the menu select **Containers**, select the container you want to duplicate then click **Duplicate/Edit**.

<figure><img src="/files/M9dsqK4zcuO3jDUAvaWj" alt=""><figcaption></figcaption></figure>

Make the required changes to the container configuration, making sure you enter a new container name in order to create a duplicate. When you're finished, click **Deploy the container**.


---

# 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.portainer.io/sts/user/docker/containers/edit.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.
