Back to Portainer

Attach a volume to a container

user/docker/containers/attach-volume.md

1.23.21.2 KB
Original Source

Attach a volume to a container

{% hint style="danger" %} This article explains how to attach a new volume to a running container. This operation destroys the running container and starts a new one with the volume attached.

Always back up your data before running this operation. {% endhint %}

From the menu select Containers, select the container that you want to attach a volume to, then click Duplicate/Edit.

<figure><figcaption></figcaption></figure>

Scroll down to Advanced container settings. Click Volumes then click map additional volume.

<figure><figcaption></figcaption></figure>

In the container field enter the path. In the volume field enter the volume to attach to the container.

<figure><figcaption></figcaption></figure>

When you're ready, click Deploy the container. When the confirmation message appears, click Replace.

<figure><figcaption></figcaption></figure>