Wanting to install NC AIO with docker bind volumes

Hi all,

I’m trying to (re)install NC via docker. This time, I’m wanting all of the volumes mounted under ~/shared/NextCloud on the host computer. I’m doing this because I have backups that run on ~shared…

However, when I try to launch the container(s) I get this error message:

docker: Error response from daemon: error while mounting volume ‘/var/lib/docker/volumes/nextcloud_aio_masterc
ontainer/_data’: failed to mount local volume: mount /home/shared/NextCloud/config :/var/lib/docker/volumes/ne
xtcloud_aio_mastercontainer/_data, flags: 0x1000: no such file or directory.

Here is the script I’m using to start the container:

sudo docker volume create --driver local --name nextcloud_aio_nextcloud_datadir \
        -o device="/home/shared/NextCloud/aio_data" -o type="none" -o o="bind"

sudo docker volume create --driver local --name nextcloud_datadir \
        -o device="/home/shared/NextCloud/data" -o type="none" -o o="bind"

sudo docker volume create --driver local --name nextcloud_aio_mastercontainer \
        -o device="/home/shared/NextCloud/config " -o type="none" -o o="bind"

sudo docker run \
        --init \
        --sig-proxy=false \
        --name nextcloud-aio-mastercontainer \
        --restart always \
        --publish 6080:80 \
        --publish 6081:8080 \
        --publish 6443:11000 \
        --env APACHE_PORT=11000 \
        --env NEXTCLOUD_DATADIR="nextcloud_aio_nextcloud_datadir" \
        --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
        --volume /var/run/docker.sock:/var/run/docker.sock:ro \
        nextcloud/all-in-one:latest

I believe I have created the directories that need to be present… and then some, perhaps.

$ tree ~shared/NextCloud/
/home/shared/NextCloud/
├── aio_data
│ └── _data
├── config
│ └── _data
└── data
└── _data

So, what am I doing wrong?

BTW, what is the advantage of running the AIO version of NC rather than the “standard” version like that at https://hub.docker.com/_/nextcloud/

Mike.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

[/details]

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • replace me
  • Operating system and version (e.g., Ubuntu 24.04):
    • replace me
  • Web server and version (e.g, Apache 2.4.25):
    • replace me
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • replace me
  • PHP version (e.g, 8.3):
    • replace me
  • Is this the first time you’ve seen this error? (Yes / No):
    • replace me
  • When did this problem seem to first start?
    • replace me
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • replace me
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • replace me

Summary of the issue you are facing:

[…]

Steps to replicate it (hint: details matter!):

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

PASTE HERE

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

PASTE

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

PASTE HERE

Apps

The output of occ app:list (if possible).

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

I think you’re just missing your OS username in the path. The actual path to ~/shared is likely something like /home/USERNAME/shared.

1 Like

Thanks for taking a look at my problem.

Actually, the path is correct. I’m putting all of my containers in directories in the shared user directory, ~shared. So, /home/shared/NextCloud is correct.

The eventual plan is that the shared user will own all of the containers.

My google-foo is implying that I can’t create a named volume AND define where it’s stored on the host. But this doesn’t seem reasonable.

And yet, I find that docker insists on pointing my volumes to /var/lib/docker

$ sudo docker inspect nextcloud_aio_mastercontainer
[
{
“CreatedAt”: “2025-04-25T15:33:42-04:00”,
“Driver”: “local”,
“Labels”: null,
“Mountpoint”: “/var/lib/docker/volumes/nextcloud_aio_mastercontainer/_data”,
“Name”: “nextcloud_aio_mastercontainer”,
“Options”: {
“device”: "/home/shared/NextCloud/config ",
“o”: “bind”,
“type”: “none”
},
“Scope”: “local”
}
]

At this point, I’m wondering what the benefit of running the AIO version of Nextcloud vs. the single-container version at https://hub.docker.com/_/nextcloud/

That image only creates one container, and I know where the mount points need to be. Thoughts?

Mike.

So, I’ve tried a few more things to get this working. I’ve pre-created the volumes that I think NC needs and tried to start the main container.

Like this:

sudo docker volume create --driver local --name nextcloud_aio_nextcloud_datadir
-o device=“/home/shared/NextCloud/aio_data” -o type=“none” -o o=“bind”

sudo docker volume create --driver local --name nextcloud_datadir
-o device=“/home/shared/NextCloud/data” -o type=“none” -o o=“bind”

sudo docker volume create --driver local --name nextcloud_aio_mastercontainer
-o device="/home/shared/NextCloud/config " -o type=“none” -o o=“bind”

sudo docker run
–init
–sig-proxy=false
–name nextcloud-aio-mastercontainer
–restart always
–publish 6080:80
–publish 6081:8080
–publish 6443:11000
–env APACHE_PORT=11000
–env NEXTCLOUD_DATADIR=“nextcloud_aio_nextcloud_datadir”
–volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config
–volume /var/run/docker.sock:/var/run/docker.sock:ro
nextcloud/all-in-one:latest

However, when I try to run this script, I get:

$ sudo ./Start.sh
[sudo] password for mdiehl:
nextcloud-aio-mastercontainer
nextcloud-aio-mastercontainer
nextcloud_aio_nextcloud_datadir
nextcloud_datadir
nextcloud_aio_mastercontainer
docker: Error response from daemon: error while mounting volume ‘/var/lib/docker/volumes/nextcloud_aio_mastercontainer/_data’: failed to mount local volume: mount /home/shared/NextCloud/config :/var/lib/docker/volumes/nextcloud_aio_mastercontainer/_data, flags: 0x1000: no such file or directory.

This doesn’t make sense to me. Is there something wrong with my syntax that I just can’t see?

Mike.