Volume management in Docker - still no working Nextcloud

If anyone would like to talk me through the instructions on the Docker Hub page?
I do understand English, but that description on how to set up volumes is a bit lacking and I would like to get those steps explained with a bit more of a pedagogic approach…


The whole Persistent data section seems to be written for people who are already Docker Professors with Laureate, not you regular Joe trying to learn. And that is relevant since that is the step that is currently failing…

Data inside a Docker-container does not survive an upgrade of the Docker image, hence you typically mount an external directory or volume to it to persist the data. Volumes have a few security and portability advantages, but for practical purposes they are pretty much just a standardized way to mount a directory from the host system.

In Portainer you just create a named volume first and then when creating the Nextcloud docker container you configure the directory as linked to the named volume.
If you don’t do that, a volume with a random name will be created, which makes it a bit difficult to figure out were your Nextcloud data went and runs a higher risk of accidental deletion as unnamed volumes are typically used for less important data such as log files that are meant to persists only temporarily.

OK, so that should really be our first concern for nextcloud in this environment, even before we start pulling image and running stuff. Not very obvious.

Running this would create the appropriate volume:?

docker run -d \
-v nextcloud:/var/www/html \

What I am actually telling Docker to do with above line?

There is also a section about what can be done, but what is essential and what is just “do if you like and know what you are doing”?

That command would create a named volume called “nextcloud” and reference/mount the “/var/www/html” directory inside the container to it. Then it would start the nextcloud container.

The “can be done” part is just about splitting that directory into multiple volumes, so that for example you could put only the data directory into a different server or such. But that is really only for more advanced setups.

Edit: are you using Portainer or not?

Thanks, yes I am using Portainer, but in this it is kinda easier to understand the logic in Docker first and then look for relevant options in Portainer.

Hmm, so that would pull-start the nextcloud right off the bat… should work I guess

Only another Portainer user would know how to get this exactly right in the interface and Portainer does not have a terminal so I run that via Fedora > Cockpit > Terminal.
There are input fields for cmd line options when deploying Containers, but this is probably a bit more complex than just feeding the options to the run line… at least for me.

(My setup is a maxed Proliant server with Windoes Server and running Fedora in Hyper-V. )

Nope, despite using that and trying a few times it is not getting the volume part.

There are two paths that are created.

Mount Path: /var/lib/docker/volumes/nextcloud/_data


Container Volume: /var/www/html

While playing with both paths and variations of them, nothing works.

Can’t create or write into the data directory /var/lib/docker/volumes/nextcloud/_data

And I did that in Docker cli, not in portainer. Portainer picks up the Container and lists it among other containers with all parameters.

@DevConram have a break and enjoy one of millions “docker 101” videos explaining the docker basics.


when you’ve done that, you may want to start with a simple docker-compose example:

to get a basic nextcloud up&running. if that doesn’t run out-of-the-box you have a problem with docker. not nextcloud.

what do you mean by: “playing around”?

you (in person) shouldn’t read or write data into that directory. that directory is handled by docker. which command did you use to get this error?

might not be the best choice. redhat tries to replace docker with podman. so the docker support in fedora might end some days.

I prefer written instructions. Avoid vids when possible, but I will give it a shot. Hem, no I am NOT just looking at any random vid. Thank you kind sir.

What I mean by playing around is testing the two given options, and also slight variant with or without final “/”.

That was the Nextcloud Setup that wanted to write to that directory, the error comes from the setup page after feeding it credentials and database information.

I would have gone for CentOS, but they are also being dumped by RedHat favoring CentOS Stream.

Debian and OpenSuse are of course still options.

So I scrapped all of the above and doing it on my hosting provider instead. It will of course cost me and the amount of storage will be severely limited but if this is so complex to get running and getting a few simple answers so hard and the setup in Docker so fucking complex, well screw it.