Nextcloud on a Raspberry Pi
This page contains affiliate links. If you buy through them, this site may earn a commission at no extra cost to you. How affiliate links work here.
A Raspberry Pi 5 with an SSD runs Nextcloud well for a household. Install Nextcloud All-in-One (AIO) with Docker on Raspberry Pi OS Lite (64-bit), boot from an SSD, keep your files on a separately powered USB drive, and turn on AIO’s built-in backups. Use Tailscale for private access, or forward port 443 for public sharing, and never expose the AIO admin interface.
At a glance
| Item | Recommendation |
|---|---|
| Board | Raspberry Pi 5, 4 GB or 8 GB (a Pi 4 also works) |
| OS | Raspberry Pi OS Lite (64-bit), based on Debian 13 Trixie |
| Install route | Nextcloud All-in-One on Docker |
| System disk | NVMe SSD on the M.2 HAT+, or a USB 3 SSD; not the SD card |
| Data disk | USB 3 SSD or hard drive with its own power, formatted ext4 |
| Remote access | Tailscale Serve (private), or port 443 forwarded with AIO’s Let’s Encrypt |
| Backups | AIO’s BorgBackup to a second drive, plus a copy off-site |
For other ways to keep your own files, see the cloud storage hub and the overview of self-hosted cloud storage options.
Choose an install route
All four common routes still offer arm64 builds. Status as checked on 2026-12-02:
| Route | Arm64 on a Pi | Nextcloud version | Notes |
|---|---|---|---|
| Nextcloud All-in-One | Yes (aarch64/arm64) | Follows AIO’s tested channel | Official method; Docker; bundles database, cache, TLS, backups |
| NextcloudPi | Image for “Raspberry Pi 4+” | 34.0.2 in v1.59.0 | Maintained; Debian Trixie; Pi 5 not named |
| Snap | Yes (arm64) | 35.0.3 on latest/stable | Needs snapd on Raspberry Pi OS |
| Manual (admin manual) | Yes, any 64-bit Debian 13 | Current release | You build and maintain the whole stack |
Nextcloud All-in-One is the recommendation. Nextcloud calls it the official installation method. Its README lists x86_64 and aarch64/arm64 as supported CPUs and says it includes PostgreSQL, Redis and APCu caching, automatic TLS through Let’s Encrypt, and a backup solution based on BorgBackup. It is free for up to 100 users.
NextcloudPi is alive. Version 1.59.0 shipped on 2026-11-06 with support for Nextcloud 34 and PHP 8.5, and v1.58.0 added the upgrade path to Debian 13. The current Raspberry Pi image is labelled “Raspberry Pi 4+”, and neither the README nor the release notes mention the Pi 5 by name, so treat Pi 5 support as unconfirmed. Its Docker version is discontinued, and its curl install script “assumes a clean Debian install, and there is no rollback method”. It also trails the current Nextcloud major release.
The snap, published by Nextcloud’s verified account, has arm64 builds at 35.0.3snap3 in the latest/stable channel. Its README lists Apache 2.4, PHP 8.4, MySQL 8.4 and Redis, and a nextcloud.enable-https command for Let’s Encrypt. Snapcraft’s instructions for Raspberry Pi OS install snapd with apt, then reboot. The snap is a reasonable fallback if you do not want Docker.
A manual install follows the Nextcloud admin manual. For Nextcloud 35 it lists Debian 13 (Trixie) as supported and PHP 8.3, 8.4 and 8.5, with 8.5 recommended. Debian 13’s default PHP package is 8.4, which is in the supported range. You then set up the web server, database, caching, cron and TLS yourself. Choose it only if you want to learn the stack.
Hardware and storage
Get a Raspberry Pi 5: a 2.4 GHz quad-core Cortex-A76, two USB 3.0 ports and a PCIe 2.0 x1 interface, with 1 to 16 GB of RAM. Nextcloud asks for at least 128 MB per process and recommends 512 MB, and AIO also runs PostgreSQL, Redis and several helper containers, so pick 4 GB for a small household and 8 GB if you want optional extras. The Raspberry Pi home server guide covers board choice, cooling and OS setup.
Use the official 27W USB-C power supply (5.1 V, 5 A). Raspberry Pi’s documentation says a Pi 5 on a 5 A supply gives 1.6 A to downstream USB devices, but restricts them to 600 mA on any other supply, and disables USB boot by default on a 3 A supply.
Keep the system off the SD card. The AIO documentation calls SD cards disrecommended because they “cripple the performance” and are not meant for the many writes the database makes. Raspberry Pi rates its own A2 cards at 2,000 random 4K write IOPS on a Pi 5, against 70,000 for its 256 GB NVMe SSD. Boot from one of these:
- NVMe on the M.2 HAT+: the standard version takes 2230 and 2242 drives over the single PCIe 2.0 lane. In
raspi-config, choose a Boot Order option under Advanced Options that includes NVMe. - A USB 3 SSD, which also works on a Pi 4. Pi 4 and newer boards boot from USB once it is in the boot order.
Put your files on a second drive. A USB 3 SSD or hard drive works; AIO notes that hard drives work but are much slower than SSDs. Raspberry Pi’s documentation suggests an externally powered USB hub for high-power devices, so pick a drive with its own power supply or use a powered hub. AIO recommends ext4 for a separate drive. Mount it permanently at a path such as /mnt/ncdata and confirm it survives a reboot before you install.
For multi-disk storage and RAID, a Pi is a weak base; see network storage at home.
Install Nextcloud All-in-One
1. Install Docker
Flash Raspberry Pi OS Lite (64-bit). Raspberry Pi describes it as “a port of Debian Trixie with no desktop environment”. Docker’s Raspberry Pi OS page covers only the 32-bit edition and tells 64-bit users to use the Debian arm64 packages. These commands come from Docker’s Debian guide:
# Add Docker's official GPG key:
sudo apt update
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/debian
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Docker’s documentation warns that ports published by containers bypass ufw rules. A host firewall will not hide AIO’s ports, so your router must.
2. Understand the mastercontainer
AIO starts with one container, the mastercontainer. It mounts the Docker socket so it can create, update and remove the other containers (Nextcloud, PostgreSQL, Redis, Apache and any optional ones). In effect it controls Docker on the Pi. It also serves the AIO admin interface on port 8080 with a self-signed certificate, uses port 80 for Let’s Encrypt challenges, and serves the interface with a valid certificate on port 8443. Nextcloud itself later answers on 443.
3. Start it
This is the official command with one addition from the AIO README, NEXTCLOUD_DATADIR, which stores Nextcloud’s files on your data drive. Set it now: the README warns not to change it after installation.
sudo docker run \
--init \
--sig-proxy=false \
--name nextcloud-aio-mastercontainer \
--restart always \
--publish 80:80 \
--publish 8080:8080 \
--publish 8443:8443 \
--env NEXTCLOUD_DATADIR="/mnt/ncdata" \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
ghcr.io/nextcloud-releases/all-in-one:latest
Do not rename the container or the nextcloud_aio_mastercontainer volume; updates and backups depend on them. For production, the README suggests its example Compose file instead of docker run.
4. Finish in the browser
Open https://192.168.1.20:8080, using your Pi’s LAN address and not a domain, and accept the self-signed certificate. Save the passphrase it shows, enter your domain (for example cloud.example.org), and choose optional containers. AIO does not accept an IP address instead of a domain. If you have none, the interface can register a free dedyn.io subdomain through deSEC.
Reach it from outside
The AIO README lists only 443/TCP as mandatory to open when you use the interface on 8080 internally, plus 3478 TCP and UDP if you enable Talk. Never forward 8080 or 8443. Manage AIO from your LAN or a VPN.
- Port forward with built-in TLS. Point your domain at your public address and forward 443 to the Pi. The Apache container obtains a Let’s Encrypt certificate automatically. This needs a reachable public address.
- Tailscale. AIO’s reverse proxy docs recommend Tailscale over Cloudflare where possible and list Tailscale Serve for private, tailnet-only access. Tailscale Serve proxies a local port to your tailnet and provisions HTTPS certificates for its name. As with any reverse proxy, you start AIO with
APACHE_PORTset, and the docs allowAPACHE_IP_BINDING=127.0.0.1when the proxy connects through localhost, as Serve does. Nothing is exposed publicly. - Cloudflare Tunnel. Cloudflare Tunnel needs no inbound ports, and AIO treats it as a reverse proxy. The README lists caveats: Cloudflare decrypts all traffic, the free plan limits non-chunked uploads to 100 MB, requests time out after 100 seconds, and Talk’s TURN server will not work behind it.
Both proxy routes follow the AIO reverse proxy documentation, which changes the startup command.
What performance to expect
Nextcloud publishes no Pi benchmarks, so plan from the documented facts.
- Caching is handled. The admin manual recommends APCu alone for a small home server, and APCu plus Redis for distributed caching and file locking on a larger single server. AIO ships APCu, Redis and PHP opcache already configured. A manual or snap install needs this set up; the snap enables APCu only on systems with at least 2 GB of RAM.
- Previews cost CPU and memory. Thumbnails are generated for images and text by default. The admin manual suggests disabling previews on servers with limited resources, and caps preview memory with
preview_max_memory. Expect a large photo upload to keep the CPU busy for a while. - Optional containers add load. Nextcloud Office, ClamAV, full-text search (Java with a 512 MB heap by default) and Talk recording each run as extra services. Enable only what you use.
- Background jobs. For manual installs the admin manual recommends system cron calling
cron.phpevery 5 minutes rather than the default AJAX mode. - Storage dominates. The database and app data belong on SSD; AIO documents moving the appdata folder to an SSD when the data directory sits on a hard drive.
Check what an always-on Pi and drives will cost with the home server power cost calculator.
Backups
AIO’s backup uses BorgBackup: incremental, compressed and encrypted. In the AIO interface, enter a mount point on a separate drive, such as /mnt/backup, and create the first backup. Store the encryption key it shows; without it you cannot restore. After the first backup you can enable daily backups and automatic updates of containers and apps. AIO can also back up directly to a remote Borg repository over SSH, which gives you the off-site copy a USB drive next to the Pi cannot. Files mounted through the External storage app are not included.
For snap or manual installs, the admin manual lists five things to keep: the config folder, the data folder, the theme folder, custom apps, and the database. Put the server into maintenance mode while you copy them.
Updates
In AIO, updates are buttons: stop the containers, back up, then start and update. The mastercontainer has its own update step. AIO waits for at least the first patch release of a new major version before shipping it, and sends a daily “AIO is outdated!” notice if the Nextcloud image is older than 90 days.
Nextcloud cannot skip major versions. The admin manual says to reach the latest point release of your current major, then upgrade one major at a time. A neglected Pi can need several upgrades in a row, so update monthly, and keep the OS patched.
When a Pi is the wrong choice
If your connection has no public address and you need public share links, or you do not want to replace failed drives and restore from backup, a VPS or managed Nextcloud may suit you better. Compare the options in VPS vs home server vs managed hosting. If you have already built a Pi server, the Pleroma on a Raspberry Pi guide uses the same storage and power setup.
Frequently asked questions
- Which Nextcloud install method is best on a Raspberry Pi 5?
- Nextcloud All-in-One (AIO). It is the official installation method, it supports arm64, and it bundles PostgreSQL, Redis, APCu, automatic TLS and a BorgBackup-based backup tool. Run it with Docker on Raspberry Pi OS Lite (64-bit), with the system on an SSD.
- Is NextcloudPi still maintained?
- Yes, at the time of checking. Version 1.59.0 was released on 2026-11-06 with Nextcloud 34 and PHP 8.5 on Debian Trixie. Its Raspberry Pi image is labelled for the Pi 4 and later, and its release notes do not mention the Pi 5 by name.
- Can I run Nextcloud from the SD card?
- It will start, but the AIO documentation advises against SD cards because the database and other parts make many writes, which cripple performance and wear the card. Boot from an SSD and keep your files on an SSD or a hard drive.
- Do I need a domain name for Nextcloud AIO?
- Yes. AIO does not accept an IP address instead of a domain and requires working HTTPS. If you have no domain, the AIO interface can register a free dedyn.io subdomain through deSEC, or you can use Tailscale for private access.
- Can I skip Nextcloud major versions when updating?
- No. The admin manual says you must first move to the latest point release of your current major version, then upgrade one major version at a time. Update regularly so you never fall several majors behind.
Sources, checked December 2, 2026
- Nextcloud All-in-One README (GitHub)
- Nextcloud All-in-One: reverse proxy documentation
- NextcloudPi repository README
- NextcloudPi release v1.59.0
- NextcloudPi changelog
- Nextcloud snap on Snapcraft
- Snapcraft: Install Nextcloud on Raspberry Pi
- Nextcloud snap README (nextcloud-snap)
- Nextcloud admin manual: System requirements
- Nextcloud admin manual: Memory caching
- Nextcloud admin manual: Background jobs
- Nextcloud admin manual: Previews configuration
- Nextcloud admin manual: Backup
- Nextcloud admin manual: How to upgrade
- Debian packages: php in trixie
- Docker docs: Install Docker Engine on Debian
- Docker docs: Install Docker Engine on Raspberry Pi OS (32-bit)
- Raspberry Pi 5 product page
- Raspberry Pi 27W USB-C Power Supply
- Raspberry Pi SD Cards
- Raspberry Pi SSDs
- Raspberry Pi M.2 HAT+
- Raspberry Pi hardware documentation (power, boot order, NVMe boot)
- Raspberry Pi OS downloads
- Tailscale docs: Tailscale Serve
- Cloudflare docs: Cloudflare Tunnel