Self-Hosting Nextcloud on a Raspberry Pi: Files, Calendar, and Contacts Without the Cloud
Our Raspberry Pi self-hosting coverage includes Immich for photos and Syncthing for continuous file sync, but neither replaces the broader "personal cloud office suite" role that Google Drive, Google Calendar, and Google Contacts fill for most households — synced files with sharing links, a web-based calendar that your phone subscribes to over CalDAV, and a contacts list that stays in sync across devices over CardDAV. Nextcloud is the standard open-source answer to that whole bundle, and it runs well on a Raspberry Pi 5 for a household or small shop's worth of users. This guide covers getting it running with Docker, the storage and backup decisions that matter most, and which of its (very large) feature set is actually worth turning on for a home Pi deployment versus skipping.
Hardware and Storage Planning First
Unlike a lot of the single-purpose self-hosted services on this site, Nextcloud's whole job is accumulating your files — so storage planning matters more here than CPU or RAM. A Pi 5 with 4–8GB of RAM handles the Nextcloud web application and a small-to-medium household's sync load without issue, but the SD card or boot NVMe drive almost never has enough space to hold everyone's actual files long-term. Plan on attaching a USB SSD or spinning hard drive (see our Pi 5 NVMe and dual-NVMe guides, or a simple USB3 external drive for a lower-cost option) as dedicated storage for the Nextcloud data directory, separate from the boot drive running the OS and Docker images.
Installation with Docker Compose
The official Nextcloud Docker image, combined with a MariaDB container for the database and Redis for caching, is the most maintainable path — avoid the manual LAMP-stack install method unless you specifically want to hand-tune the PHP and Apache configuration, since Docker handles version compatibility between Nextcloud, PHP, and the database for you.
- Create a project directory with subfolders for the Nextcloud app data, the database data, and (critically) a bind mount to your attached USB SSD or drive for the actual file storage.
- Write a docker-compose.yml with three services: db (MariaDB), redis, and app (the Nextcloud image), with the app service's environment variables pointing at the database and Redis containers, and a volume mount for /var/www/html/data pointed at your external drive's mount point rather than the SD card or boot drive.
- Bring the stack up with docker compose up -d, then complete the web-based setup wizard at http://<pi-ip>:<port>, which creates the admin account and finalizes the database connection.
Set default_phone_region and your timezone in the generated config.php after initial setup — these affect calendar event times and contact phone number formatting, and they're easy to miss during the wizard.
Reverse Proxy and HTTPS
Nextcloud's mobile and desktop sync clients, along with CalDAV/CardDAV sync, expect a proper HTTPS endpoint, and several features (including the security admin panel's own checks) will nag persistently if accessed over plain HTTP. Put Nginx or Caddy in front of the container with a Let's Encrypt certificate if you want this reachable outside your home network, or run it purely over Tailscale if remote access is only ever going to be you and your household connecting back to a home network — the Tailscale-only path skips port forwarding and public DNS entirely and is meaningfully lower-maintenance for a single-household deployment.
Calendar and Contacts: Turn On CalDAV/CardDAV Early
Nextcloud's calendar and contacts apps aren't enabled by default on a fresh install — install them from the Nextcloud app store (built into the admin web UI) right after initial setup. Once enabled, every user gets a CalDAV and CardDAV endpoint that any standard calendar or contacts app (iOS/macOS Calendar and Contacts, Android's DAVx5, Thunderbird) can subscribe to directly, syncing in both directions exactly like a Google or iCloud account would, just pointed at your Pi instead.
- iOS/macOS: add a CalDAV/CardDAV account in Settings pointing at your Nextcloud server's /remote.php/dav endpoint with an app password (generated in Nextcloud's security settings, not your main login password).
- Android: DAVx5 is the standard third-party sync client, since Android has no built-in CalDAV/CardDAV support — it bridges Nextcloud's calendars and contacts into the native Android calendar and contacts apps.
File Sync: Desktop and Mobile Clients
Nextcloud's own desktop sync client (Windows, macOS, Linux) and mobile apps work similarly to Dropbox or Google Drive's sync clients — a local folder that mirrors your server-side files, with selective sync for choosing which folders actually get downloaded to a given device. This is a genuinely different use case from Syncthing's peer-to-peer continuous sync covered elsewhere on this site: Nextcloud centralizes files on your Pi (or attached drive) as the single source of truth with sharing links and permission control, while Syncthing keeps multiple devices in sync with each other without a central server. Running both isn't redundant if you want Syncthing for device-to-device folder mirroring and Nextcloud specifically for the sharing-link and multi-user-permission features neither Syncthing nor Immich provide.
What to Skip on a Home Pi Deployment
Nextcloud's app store includes dozens of optional apps — a full office suite (Collabora/OnlyOffice), video calls (Nextcloud Talk), a Kanban board, RSS reader, and more. Most of these add meaningful CPU and RAM overhead and are worth skipping on a Pi unless you specifically need them:
- Collabora/OnlyOffice document editing runs as a separate, fairly heavy service and generally isn't worth running on a Pi — editing a document locally and letting Nextcloud sync the file works fine without it for most home use.
- Nextcloud Talk (video calls) needs a TURN server for reliable connections across different networks and adds real load during active calls — reasonable to skip in favor of existing video call tools unless Nextcloud Talk specifically is a requirement.
- Full-text search and preview generation for large photo/document libraries can meaningfully load a Pi's CPU during initial indexing — expect a slow first scan of a large existing file library rather than near-instant availability.
Backups
Nextcloud's state lives in three places that all need to be backed up together for a consistent restore: the MariaDB database, the config.php and app data under the Nextcloud container's app directory, and the actual user files on your attached drive. Put the database container into maintenance mode (occ maintenance:mode --on) briefly during backup to avoid an inconsistent snapshot, dump the database, then copy the config and data directories, and automate the whole sequence with our Restic/Borg backup guide rather than relying on manually remembering to run it.
Run lean — files, calendar, and contacts, with the heavier optional apps left off — and a Raspberry Pi 5 with a real external drive attached handles Nextcloud comfortably for a household or small shop, replacing the parts of Google's ecosystem most people actually use day to day without handing that data to a third party.