Skip to main content

📚 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

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

        Created and maintained by MSLS Partners LLC 📚

        Empowering IT with clear documentation and professional best practices.

        Version 1.0 | Last Reviewed: May 2025