Skip to content

Commit b8b4dd8

Browse files
Merge pull request #2315 from tzerber/volume-clarification
Clarify Readme on bind volumes to avoid `apps` / `custom_apps` mishaps
2 parents dd663d6 + a823945 commit b8b4dd8

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,38 @@ If you want to use named volumes for all of these, it would look like this:
8787
```console
8888
$ docker run -d \
8989
-v nextcloud:/var/www/html \
90-
-v apps:/var/www/html/custom_apps \
90+
-v custom_apps:/var/www/html/custom_apps \
9191
-v config:/var/www/html/config \
9292
-v data:/var/www/html/data \
9393
-v theme:/var/www/html/themes/<YOUR_CUSTOM_THEME> \
9494
nextcloud
9595
```
9696

97+
If you'd prefer to use bind mounts instead of named volumes, for instance, when working with different device or network mounts for user data files and configuration:
98+
```console
99+
$ docker run -d \
100+
-v /path/on/host/to/folder/nextcloud:/var/www/html \
101+
-v /path/on/host/to/folder/custom_apps:/var/www/html/custom_apps \
102+
-v /path/on/host/to/folder/config:/var/www/html/config \
103+
-v /path/on/host/to/folder/data:/var/www/html/data \
104+
-v /path/on/host/to/folder/theme:/var/www/html/themes/<YOUR_CUSTOM_THEME> \
105+
nextcloud
106+
```
107+
108+
Here’s the same example using Docker's more detailed `--mount`. Note that with `-v` or `--volume`, the specified folders are created automatically if they don't exist. However, when using `--mount` for bind mounts, the directories must already exist on the host, or Docker will return an error.
109+
```console
110+
$ docker run -d \
111+
--mount type=bind,source=/path/on/host/to/folder/nextcloud,target=/var/www/html \
112+
--mount type=bind,source=/path/on/host/to/folder/custom_apps,target=/var/www/html/custom_apps \
113+
--mount type=bind,source=/path/on/host/to/folder/config,target=/var/www/html/config \
114+
--mount type=bind,source=/path/on/host/to/folder/data,target=/var/www/html/data \
115+
--mount type=bind,source=/path/on/host/to/folder/theme,target=/var/www/html/themes/<YOUR_CUSTOM_THEME> \
116+
nextcloud
117+
```
118+
The examples above use figurative directory `/path/on/host/to/folder/` for bind mounts. Please modify the paths by using either a relative or absolute path.
119+
120+
NOTE: Do not confuse the `apps` and `custom_apps` folders. These folders contain different sets of apps, and mixing them will result in a broken installation. The former contains "shipped" apps, which come with Nextcloud Server. The latter contains apps you install from the App Store.
121+
97122
### Custom volumes
98123

99124
If mounting additional volumes under `/var/www/html`, you should consider:

0 commit comments

Comments
 (0)