Safely Recreating Nextcloud AIO Docker Containers with NFS Storage

๐ŸŽฏ Purpose

To safely re-create all Docker containers in your Nextcloud AIO deployment while preserving data and configuration stored in persistent volumes.

๐Ÿ“ Requirements

๐Ÿ“ฆ Why This Works

Nextcloud AIO separates runtime containers from data using persistent volumes:

As long as these volumes remain untouched, you can destroy and recreate containers safely.

๐Ÿ›  Step-by-Step Procedure

Step 1: Shut Down Containers

cd ~/nextcloud-aio
docker compose down

Step 2: Update Images (Optional)

docker compose pull

Step 3: Recreate Containers

docker compose up -d

Your containers will be rebuilt and relaunched using existing configurations and data.

๐Ÿงช Verify Volume Health

docker volume ls
docker volume inspect nextcloud_ncdata

You should see the correct mount info like:

"device": ":/mnt/hdd-storage/nfs-nextcloud",
"o": "addr=192.168.100.11,nfsvers=4,soft,timeo=900,retrans=5,rw,noatime,nolock"

๐Ÿ”ฅ Optional: Clean Up Old Images

docker image prune -a
docker container prune

๐Ÿ” UFW Rules (if using UFW)

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 8080/tcp
sudo ufw allow 3478/tcp
sudo ufw allow 3478/udp

This ensures access to HTTP/HTTPS and TURN services.

โœ… Summary

You can safely re-create all containers in your Nextcloud AIO environment without data loss by:

This helps keep your Nextcloud instance stable, secure, and up to date.

Maintained by MSLS Partners LLC โ€” Internal Infrastructure Guide


Revision #1
Created 2 May 2025 22:17:07 by joliveira
Updated 2 May 2025 22:17:30 by joliveira