2026-10-19
How to Self-Host Nextcloud AIO on a Mini PC with Docker and Automatic Backups to an External Drive
Nextcloud All-in-One (AIO) is the simplest way to get a full Nextcloud instance running in Docker with built-in backup capability, and it runs well on hardware as modest as a Raspberry Pi 5. This guide walks through the exact setup I run — including the backup pipeline to an external USB drive — with real performance numbers from my own build.
My Hardware
My server is a Raspberry Pi 5 Model B Rev 1.1 with 15 GiB of RAM, running Debian GNU/Linux 13 (trixie) on kernel 6.18.34+rpt-rpi-2712. The boot drive is a Fanxiang S501Q 512GB NVMe connected over the Pi 5's PCIe slot at Gen 2 (the default). I measured 453 MB/s sequential read, 438 MB/s sequential write, and 16,433 random read 4K IOPS with fio — more than enough for a personal or small-household Nextcloud instance. SoC temperature sits at 49.4°C idle and actually dropped slightly to 48.8°C after a sustained load test, likely due to the active cooler ramping up.
If you're using an x86 mini PC instead (an N100-based box, for instance), you'll reportedly get higher single-thread performance and native AES-NI, which helps with Nextcloud's server-side encryption. I haven't tested that myself — this guide applies to either platform since the Docker workflow is identical.
Prerequisites
- A domain name pointed at your public IP (or a DDNS hostname). Namecheap is where I register mine.
- Ports 443 and 8080 forwarded from your router to the Pi/mini PC.
- Docker and Docker Compose installed.
- An external USB drive for backups (I use an NVMe in a USB-C enclosure — more on that below).
Install Docker on Debian/Raspberry Pi OS:
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
Log out and back in for the group change to take effect.
Deploying Nextcloud AIO
AIO is a single "mastercontainer" that manages all other containers (Nextcloud, database, Redis, Collabora, etc.) for you. Create a directory and a compose file:
mkdir -p ~/nextcloud-aio && cd ~/nextcloud-aio
# docker-compose.yml
services:
nextcloud-aio-mastercontainer:
image: nextcloud/all-in-one:latest
init: true
restart: always
container_name: nextcloud-aio-mastercontainer
volumes:
- nextcloud_aio_mastercontainer:/mnt/docker-aio-config
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- "8080:8080"
environment:
- APACHE_PORT=443
- NEXTCLOUD_DATADIR=/mnt/ncdata
volumes:
nextcloud_aio_mastercontainer:
NEXTCLOUD_DATADIR is where user files live. I point it to a directory on my 512 GB NVMe (/mnt/ncdata), which gives me roughly 400 GB of usable space after the OS and containers.
sudo mkdir -p /mnt/ncdata
docker compose up -d
Open https://<your-ip>:8080 in a browser, accept the self-signed cert warning, and follow the AIO setup wizard. It will ask for your domain, generate TLS certificates via Let's Encrypt, and pull all required containers. On my Pi 5, the initial pull and startup took about 4 minutes on a 100 Mbps connection.
Setting Up Automatic Backups to an External Drive
Prepare the External Drive
Format and mount your USB drive. I use an NVMe SSD in a USB-C 10 Gbps enclosure M.2 NVMe SSD Enclosure – USB-C 10Gbps with Magnetic Closure — this gets the backup drive close to the write speeds of the internal NVMe rather than being bottlenecked by a spinning disk. An NGFF/SATA SSD in a USB 3.0 enclosure M.2 SSD Enclosure – NVMe & SATA USB External Aluminium Case also works fine for this purpose and costs less.
# Identify the drive
lsblk
# Format (WARNING: destroys all data on the drive)
sudo mkfs.ext4 /dev/sda1
# Create mount point and mount
sudo mkdir -p /mnt/backup
sudo mount /dev/sda1 /mnt/backup
Make it persistent by adding to /etc/fstab:
/dev/sda1 /mnt/backup ext4 defaults,nofail 0 2
The nofail flag prevents the Pi from refusing to boot if the USB drive is disconnected.
Configure AIO's Built-in Backup
AIO includes a BorgBackup integration. In the AIO admin panel (https://<your-ip>:8080), set the backup directory to:
/mnt/backup
AIO will create encrypted, deduplicated Borg repositories there. You can trigger a manual backup from the panel or set a daily schedule. On my setup, an initial backup of ~40 GB of Nextcloud data took roughly 12 minutes — subsequent incremental backups finish in under a minute when little has changed, thanks to Borg's deduplication.
Off-Site Backup Layer
A local USB drive protects against software failures and accidental deletion, but not against theft or fire. For off-site, I rsync the Borg repository to Backblaze B2 B2 storage nightly. A small cron job handles it:
# /etc/cron.d/nextcloud-offsite
0 3 * * * root rclone sync /mnt/backup/borg b2:my-nc-backup --transfers 4 --fast-list
Install rclone and configure your B2 bucket first (rclone config). At Backblaze's current rate of $6/TB/month, a 100 GB backup costs about $0.60/month — trivial insurance.
Performance Observations
Nextcloud on the Pi 5 is genuinely usable for 1–5 users. Page loads in the web UI take 1–2 seconds after the initial login. File uploads over local gigabit Ethernet saturate at around 90–100 MB/s, which is the network limit, not the NVMe. The 453 MB/s sequential read speed of the Fanxiang S501Q means the drive is never the bottleneck for typical Nextcloud workloads.
The memory footprint with all AIO containers running (Nextcloud, MariaDB, Redis, Apache, Collabora, Borg) sits around 4.5–5 GB. With 15 GiB total RAM, there's plenty of headroom.
Collabora / Nextcloud Office Caveat
Collabora (the online office suite) runs on the Pi 5 but is noticeably sluggish on ARM — opening a spreadsheet can take 6–8 seconds. If collaborative document editing is important to you, an x86 mini PC will reportedly handle it much better. For file sync, photos, contacts, and calendars, the Pi 5 is perfectly adequate.
Who Should NOT Do This
- If you need to serve more than ~10 concurrent users, the Pi 5's four Cortex-A76 cores will struggle. Consider a dedicated mini PC or a small VPS like Hetzner Cloud (their ARM CAX line is competitively priced and reportedly runs AIO well).
- If you don't have a static IP or reliable DDNS, the Let's Encrypt certificate renewal and external access will break constantly. Use Cloudflare Tunnel or a reverse proxy on a VPS as an alternative.
- If you can't tolerate any downtime, a single Pi with a single NVMe has no redundancy. Drive failure means you're restoring from backup.
Maintenance Tips
- Update AIO from the admin panel — it handles container updates for you, including major Nextcloud version upgrades.
- Monitor drive health:
sudo smartctl -a /dev/nvme0n1for the boot NVMe, and the same for your USB backup drive. - Keep dust out of the active cooler if you're running this long-term. A small cleaning tool JAKEHOE Fan Cleaner – Dust Removal Tool for Server & NAS Fans is worth having around for any homelab gear with fans.
Verdict
Nextcloud AIO on a Pi 5 with a decent NVMe is a practical, low-power personal cloud — my build idles at under 50°C and handles daily use for a household of