That behavior is expected.
Once NEXTCLOUD_DATADIR is used in Nextcloud All-in-One, the path is persisted in the configuration, not only in the container runtime arguments.
Removing and re-creating the mastercontainer does not revert the data directory.
The clean and supported way to reverse this is to properly reset the entire AIO instance, exactly as described here:
https://github.com/nextcloud/all-in-one?tab=readme-ov-file#how-to-properly-reset-the-instance
This will:
-
remove stored configuration
-
detach the external data directory
-
allow AIO to recreate and use the default Docker volume again
Before doing this, make a full backup of all data.
After the reset, I strongly recommend not using long docker run commands, but switching to a Docker Compose setup (using docker-compose.yml file).
And commands:
# Start docker
docker compose up -d
# Stop docker
docker compose down
It is easier to read, maintain, and avoids exactly this type of configuration confusion.
You can see a complete working example here (AIO + Proxmox + Nginx Proxy Manager + Watchtower):
https://help.nextcloud.com/t/proxmox-nginx-nextcloud-aio-watchtower-deployment-guide/233643?u=vawaver