๐Ÿ“š Deploying Nextcloud AIO with NFS Storage ๐Ÿ“š Guide Overview Title: Deploying Nextcloud AIO with NFS Storage Author: MSLS Partners LLC Last Updated: May 2025 Description: This guide walks through deploying Nextcloud All-in-One (AIO) using Docker Compose with NFS-mounted storage on Ubuntu Server. It includes all steps from base OS setup to application deployment. Difficulty Level: Intermediate ๐Ÿ› ๏ธ Estimated Time: 20โ€“30 minutes ๐Ÿ“– Table of Contents Purpose Requirements Install Docker and Docker Compose Prepare NFS Mount Deploy Nextcloud AIO Expected Results Troubleshooting Final Notes ๐Ÿ“– Purpose To deploy a fully-featured Nextcloud AIO server using Docker Compose, configured to use NFS storage for persistent data. ๐Ÿ“– Requirements Ubuntu Server 22.04 LTS or newer Static IP assigned (e.g., 192.168.100.19) NFS server available at 192.168.100.11 Two NFS exports: /mnt/hdd-storage/nfs-nextcloud /mnt/hdd-storage/nfs-aio-config ๐Ÿ“ฆ Install Docker and Docker Compose sudo apt update sudo apt install -y nfs-common ca-certificates curl gnupg lsb-release # Add Docker GPG key and repo sudo mkdir -p /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null # Install Docker sudo apt update sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin # Enable and start Docker sudo systemctl enable docker sudo systemctl start docker ๐Ÿ”ง Configure NFS Exports on Your NFS Server Ensure these lines are in your /etc/exports file on the NFS server: /mnt/hdd-storage/nfs-nextcloud *(rw,no_root_squash,sync,no_subtree_check) /mnt/hdd-storage/nfs-aio-config *(rw,no_root_squash,sync,no_subtree_check) Apply the exports: sudo exportfs -ra ๐Ÿš€ Deploy Nextcloud AIO with Docker Compose mkdir -p ~/nextcloud-aio cd ~/nextcloud-aio curl -O https://chat.openai.com/mnt/data/nextcloud-aio-with-nfs-volumes.yml mv nextcloud-aio-with-nfs-volumes.yml docker-compose.yml docker compose up -d Once deployed, access the AIO interface via: http://192.168.100.19:8080 ๐Ÿ“ˆ Expected Results Access to AIO web interface Auto-deployment of subcontainers (db, redis, collabora, cron, etc.) Persistent storage on NFS shares ๐Ÿ›  Troubleshooting Issue Cause Fix Nextcloud fails to initialize NFS permissions or export missing Check /etc/exports and re-export Upload limit too low PHP or env limits Check NEXTCLOUD_UPLOAD_LIMIT in compose file AIO container won't start Docker permissions Ensure docker.sock is mounted read-only ๐Ÿ“ฆ Final Notes All environment customization is handled via docker-compose.yml This method is clean, portable, and restart-safe Back up your NFS shares regularly via ZFS snapshot or rsync ๐Ÿงพ Docker Compose File Used Below is the exact docker-compose.yml configuration used to deploy Nextcloud AIO with NFS integration: version: "3.8" volumes: nextcloud_aio_mastercontainer: name: nextcloud_aio_mastercontainer nextcloud_ncdata: driver: local driver_opts: type: "nfs" o: "addr=192.168.100.11,nfsvers=4,soft,timeo=900,retrans=5,rw,noatime,nolock" device: ":/mnt/hdd-storage/nfs-nextcloud" services: nextcloud: image: nextcloud/all-in-one:latest restart: unless-stopped container_name: nextcloud-aio-mastercontainer volumes: - nextcloud_aio_mastercontainer:/mnt/docker-aio-config - nextcloud_ncdata:/mnt/ncdata - /var/run/docker.sock:/var/run/docker.sock:ro ports: - 8080:8080 environment: - APACHE_PORT=11000 - APACHE_IP_BINDING=0.0.0.0 - NEXTCLOUD_DATADIR=/mnt/ncdata - NEXTCLOUD_MEMORY_LIMIT=4096M - NEXTCLOUD_UPLOAD_LIMIT=50G - NEXTCLOUD_MAX_TIME=3600 - NEXTCLOUD_ADDITIONAL_APKS=imagemagick ocrmypdf - NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS=imagick - TALK_PORT=3478 - NEXTCLOUD_URL=https://cloud.mslspartners.com - SKIP_DOMAIN_VALIDATION=true - NEXTCLOUD_ADDITIONAL_CONFIG=\ "trusted_proxies" => ["192.168.100.1"],\n\ "forwarded_for_headers" => ["HTTP_X_FORWARDED_FOR"],\n\ "overwrite.cli.url" => "https://cloud.mslspartners.com",\n\ "overwritehost" => "cloud.mslspartners.com",\n\ "overwriteprotocol" => "https",\n\ "default_phone_region" => "US" Created and maintained by MSLS Partners LLC ๐Ÿ“š Empowering IT with clear documentation and professional best practices. Version 1.0 | Last Reviewed: May 2025