> For the complete documentation index, see [llms.txt](https://www.trentbauer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.trentbauer.com/guides/other-guides/docker-compose/mount-nfs-share-to-container.md).

# Mount NFS Share to Container

<table data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td>Time Required</td><td>5 minutes</td></tr><tr><td>Difficulty</td><td>Easy - Moderate</td></tr><tr><td>Required Knowledge</td><td>SSH, Docker Compose</td></tr></tbody></table>

<pre class="language-yaml" data-title="docker-compose.yml"><code class="lang-yaml"><strong>version: "2.3"
</strong>services:
  app:
    image: myimage
    volumes:
      - nfs:/container/path
....

volumes:
  nfs:
    driver_opts:
      type: "nfs"
      o: addr=$NFSSERV,nfsvers=4
      device: $NFSPATH
</code></pre>

{% code title=".env" %}

```
NFSSERV=fully.qualified.domain or IP address of NFS server
$NFSPATH=:/Path/To/NFS/Share
```

{% endcode %}
