Nextcloud on the Raspberry Pi – self-host your own cloud

Nextcloud on Raspberry Pi – Set Up Your Own Cloud

If you’d rather not hand your files to one of the big cloud providers, run your own with Nextcloud on a Raspberry Pi. You get a cloud for files, photos, calendars, contacts and video calls that runs entirely at home – free and with no subscription.

This guide walks you through installing Nextcloud on a Pi 4 or Pi 5, either with Nextcloud AIO on Docker or with NextcloudPi. After that you’ll make your cloud reachable from anywhere, connect your phone and computer, and set up backups. It’s up to date as of November 2026 (Nextcloud AIO 15 and NextcloudPi 1.59.0), and the screenshots come from a Raspberry Pi 5 running Raspberry Pi OS (64-bit).

In short

Nextcloud runs on the Raspberry Pi 4 and 5 with a 64-bit OS and an SSD. The official route is Nextcloud AIO on Docker; if you’d rather skip Docker, use NextcloudPi.

  • Nextcloud AIO needs a domain, even on your home network. You can get a free one from deSEC right in the setup screen.
  • Want your files on an external drive? Tell AIO before you start it for the first time. Changing it later is a hassle.
  • If you only use it at home, the deSEC domain is all you need – no port forwarding, just set the Pi as the DNS server in your router. For access on the go, forward port 443 on your router.
What is Nextcloud?

Nextcloud is free software for running your own cloud: sync files between your computer and phone, upload photos automatically, keep calendars and contacts in sync, share documents, and chat or make calls with Nextcloud Talk. There are official apps for Windows, macOS, Linux, Android and iOS. Nextcloud started in 2016 as a fork of ownCloud.

What You Need

Links marked with * are affiliate links, which makes them advertising. If you buy through one, I earn a commission at no extra cost to you. As an Amazon Associate I earn from qualifying purchases. Learn more

Our NVMe SSD guide for the Pi 5 shows how to boot from an NVMe SSD; for a Pi 4 with a USB SSD, see our USB boot guide. We don’t recommend a Raspberry Pi 3. Nextcloud AIO needs at least 2 GB of RAM for its optional features, and the Pi 3 has only 1 GB. Its USB ports are also limited to slow USB 2.0.

Choosing an Installation Method

There are two good ways to get Nextcloud onto a Raspberry Pi:

MethodDifficultyRequirementsDomain needed?Best for
Nextcloud AIO (Docker)Moderate64-bit Raspberry Pi OS with DockerYes, free from deSECRecommended if you want Office, Talk and backups in one package
NextcloudPiEasyPre-built NCP image, or an installer on Raspberry Pi OSOnly for remote accessAvoiding Docker – a complete system you just flash

AIO or NextcloudPi? If you already use Docker or want Office and video calls, AIO is the better choice: updates, backups and the extra services are built in. NextcloudPi is the better fit if you’d rather avoid Docker or want to use your cloud at home without a domain.

Method 1: Nextcloud AIO via Docker (Recommended)

Nextcloud AIO (All-in-One) is Nextcloud’s official installation method. It runs on Docker, software that starts programs in isolated packages called containers. You only start one container yourself, the master container. It sets up everything else on its own: Nextcloud, the PostgreSQL database, the Redis cache and, if you want them, Office, Talk and backups. You control it all through a web interface. You’ll need Raspberry Pi OS (64-bit) on the SSD, which you can flash with Raspberry Pi Imager – AIO only supports 64-bit systems. To check your system, run this command; it should print arm64:

dpkg --print-architecture

Step 1: Install Docker

docker --version tells you whether Docker is already installed. If it isn’t, download the official install script and run it:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

Every command in this guide uses sudo, so you don’t need to add your user to the docker group. There’s more about Docker on the Pi in our Docker guide.

Step 2: Decide Where Your Files Will Live

Unless you tell it otherwise, AIO stores your files in a Docker volume on the system drive, i.e. the SSD. If that’s big enough, skip this step. If you want your files on an external drive, mount it permanently before you start AIO for the first time. You then pass the folder to AIO when you start it. Once Nextcloud is installed, the only way to move your data is a workaround from the AIO documentation.

Our guide to setting up a USB hard drive shows how to mount a USB drive so it shows up at the same path after every reboot. In the examples here, the drive is mounted at /mnt/drive. Create a dedicated folder for Nextcloud on it rather than using the root of the drive:

sudo mkdir -p /mnt/drive/nextcloud

Step 3: Start Nextcloud AIO

You can start AIO either with a single docker run command or with a Compose file – pick just one. Both download the master container (just under 90 MB) and start it. The command is quicker to type, but Nextcloud recommends the Compose file for long-term use because settings are easier to change there – if in doubt, use it.

Already running Pi-hole on this Pi? Since version 6, its web interface uses ports 80 and 443 by default. AIO publishes port 80 when it starts, and Nextcloud itself needs port 443 later, so AIO won’t start properly while Pi-hole holds them. Move the Pi-hole web interface to port 8081 first and restart Pi-hole. If you still run Pi-hole 5, upgrade it to version 6 with pihole -up before you do this:

sudo pihole-FTL --config webserver.port '8081o,[::]:8081o'
sudo systemctl restart pihole-FTL

After that, the Pi-hole web interface is at http://YOUR-PI-IP:8081/admin. The clash on port 53 only affects the deSEC route, and step 7 covers it.

With docker run, files on the SSD:

sudo docker run \
  --init \
  --sig-proxy=false \
  --name nextcloud-aio-mastercontainer \
  --restart always \
  --publish 80:80 \
  --publish 8080:8080 \
  --publish 8443:8443 \
  --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

With docker run, files on the external drive from step 2:

sudo docker run \
  --init \
  --sig-proxy=false \
  --name nextcloud-aio-mastercontainer \
  --restart always \
  --publish 80:80 \
  --publish 8080:8080 \
  --publish 8443:8443 \
  --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
  --volume /var/run/docker.sock:/var/run/docker.sock:ro \
  --env NEXTCLOUD_DATADIR="/mnt/drive/nextcloud" \
  ghcr.io/nextcloud-releases/all-in-one:latest

With Docker Compose: Our nextcloud.yml on GitHub has the same settings as the first docker run command. Download it:

curl -fsSLO https://raw.githubusercontent.com/raspberry-tips/raspberry.tips-Resources/main/docker/nextcloud.yml

If you want your files on the external drive, open the file in nano:

nano nextcloud.yml

Remove the # and the space after it from the # environment: and # NEXTCLOUD_DATADIR: … lines, and enter your folder (/mnt/drive/nextcloud in our example). Keep the indentation as it is. Afterwards, the two lines look like this:

    environment:
      NEXTCLOUD_DATADIR: /mnt/drive/nextcloud

Save with Ctrl+O and press Enter, exit nano with Ctrl+X, then start AIO from the same folder the file is in:

sudo docker compose -f nextcloud.yml up -d

Port 8080 is the AIO admin interface. The command also opens ports 80 and 8443. Leave them in, but you won’t need them for this guide; there’s more on them under “Setting Up Remote Access”.

Step 4: Open the AIO Interface and Log In

Open your Pi’s address on port 8080 in your browser:

https://YOUR-PI-IP:8080

Run hostname -I on the Pi to find its IP address. Your browser will warn about a self-signed certificate – that’s expected here, so accept it. Always open this page by its IP address, even later once your domain is set up. Otherwise a browser security rule (HSTS) may lock you out.

The start page shows a passphrase made of several words. It’s your password for the AIO interface – write it down before you click “Open Nextcloud AIO login”, then use it to log in.

Nextcloud AIO start page showing the passphrase for the AIO interface, blanked out here
Write the passphrase down before you click the login button.

Step 5: Enter a Domain or Get a Free One from deSEC

Once you’re logged in, the “New AIO instance” section asks for the domain your Nextcloud will use. You can’t skip this, even if you only use the cloud at home. You have two options:

  • Free domain from deSEC (a nonprofit DNS provider): Expand “Don’t have a domain? Get a free one from deSEC” and click “Register free domain via deSEC”. A small window asks for your email address and, if you like, a name for the subdomain; click “Register free domain via deSEC” there as well. deSEC then sends you an email: click the link in it, go back to the window and click “I have verified my email – register domain”. The page reloads with your dedyn.io address filled in. AIO updates it whenever your IP address changes. It also puts Caddy in front of Nextcloud to handle the certificate and sets up a small DNS service (dnsmasq) for your home network.
  • Your own domain or a dynamic DNS address: It must already point to your public IP address, and port 443 must be forwarded to the Pi on your router. AIO checks this before it lets you continue and shows what’s wrong in the top right corner. If you already have your own domain, set up the address and port forwarding as described in Setting Up Remote Access first, then come back here. Without an address of your own, go the deSEC route.
Domain field in Nextcloud AIO with the section for a free deSEC domain expanded
No domain of your own? The deSEC section gets you a free subdomain.

Step 6: Choose Your Containers and Start Them

Once the domain is set, AIO shows the “Download and start containers” button at the top. Don’t click it yet – first go through the settings below it, in this order. Confirm every office or container change with “Save changes”, or AIO won’t apply it.

1. Office: Under “Optional containers”, first pick the office suite for editing documents in your browser. Both options are called “Nextcloud Office”. The default is the one “powered by Euro-Office”, an open-source document server that AIO describes as the most compatible with Microsoft formats. The alternative is the one “powered by Collabora Online”, which AIO says works best with LibreOffice’s open formats (ODF). AIO marks ONLYOFFICE as deprecated. If you don’t need browser-based office editing, choose “Disable office suite” – one fewer container saves RAM.

2. More containers: Below that are extra services. Nextcloud Talk for video calls, Imaginary for previews of formats like HEIC, and Whiteboard are selected by default. AIO lists the minimum requirements right below. You need 2 GB of RAM as soon as you enable any optional container, 3 GB once you add the ClamAV virus scanner, full-text search or Talk recording, and 5 GB plus a quad-core CPU if you enable everything. AIO recommends 1 GB more than the minimum in each case.

On paper, a 4 GB Pi can therefore take one of the three big containers. We still recommend keeping Talk, Imaginary and Whiteboard on and leaving ClamAV, full-text search and Talk recording off on 4 GB: each needs roughly 1 GB extra, and the Pi would have little headroom left for previews and multiple users. On a Pi 5 with 8 GB, AIO’s numbers say there’s enough RAM for all containers.

List of optional containers in Nextcloud AIO with the minimum RAM and CPU requirements
Below the list, AIO states how much RAM the optional containers need.

3. Time zone: Further down, enter your time zone under “Timezone change”, for example Europe/London or America/New_York, and confirm with “Submit timezone”.

4. Start: Scroll back up to the “Download and start containers” button. You don’t get to pick a version: since version 15, AIO installs the current major release, Nextcloud 35, right away.

Nextcloud AIO 15 after entering the domain, showing the Download and start containers button
The start button sits at the top – go through the settings below it first.

Now click “Download and start containers”. AIO pulls a few gigabytes of images, so allow 5 to 10 minutes or more. Once everything is running, the panel shows the username admin and the password AIO generated. If you’ve already set a backup location, they’re tucked away under “Click here to reveal the initial Nextcloud credentials”. Use these to log in to Nextcloud at https://your-domain – on your home network without port forwarding, only after step 7.

Step 7: Make It Work at Home – Set the Pi as Your DNS Server

With the deSEC domain, AIO sets up a small DNS service (dnsmasq) on the Pi. To make devices on your network resolve your domain directly to the Pi, set the Pi as the DNS server in your router – without this step, https://your-domain won’t open at home unless you’ve set up port forwarding.

Look for a “DNS server” or “Local DNS server” setting in your router’s LAN or DHCP options; our Pi-hole guide shows where to find it on common routers. Your devices only pick up the change once they renew their network settings, so reconnect to Wi-Fi or restart them. Also give the Pi a fixed IP address in your router – while it’s off, devices on your network can’t look up any names.

If you already run Pi-hole or another DNS server on your network, add a local record there that points your domain to the Pi’s IP address instead. Pi-hole and dnsmasq both need port 53. If Pi-hole runs on this Pi (see step 3), untick dnsmasq in the community containers list at the very bottom of the AIO panel and add the local record in Pi-hole instead.

Method 2: NextcloudPi (No Docker Needed)

NextcloudPi (NCP for short) is a Nextcloud distribution built for single-board computers – no Docker, with Apache, PHP and MariaDB as the database, all installed directly on the system. The current version, 1.59.0 from November 2026, ships Nextcloud 34 with PHP 8.5 on Debian 13. There are two ways to install it. Option A suits you if the Pi will only run Nextcloud and you want everything set up for you. Option B is for you if you’d rather stay on Raspberry Pi OS.

Option A: Flash the Pre-Built Image

The releases page offers the NextcloudPi_RaspberryPi.4+ image for the Pi 4 and Pi 5. It comes with its own operating system: Armbian, a Debian build for single-board computers, not Raspberry Pi OS. Flash the downloaded ZIP file with Raspberry Pi Imager, ideally to the SSD, using the “Use custom” entry at the very bottom of the operating system list. An SD card works too, but it copes less well with constant writes. Then plug the drive into the Pi, connect the Ethernet cable and power, and give it a few minutes to boot.

Not every NCP release comes with an image. If the newest one doesn’t, flash the latest image that’s available. After activation (see “After the First Boot”), update it with nc-update in the NCP panel. If that image is still on an older Debian release, you’ll also need to run sudo ncp-dist-upgrade in a terminal. To do that, turn on SSH under SSH in the panel, set a username and password, and tick “Enable sudo”.

Option B: Run the Installer on Raspberry Pi OS

On a fresh install of Raspberry Pi OS (Lite is fine), the install script sets up NCP on top of your existing system. It needs the current Raspberry Pi OS release, which is based on Debian 13. Check first; the output should read VERSION_ID="13":

grep VERSION_ID /etc/os-release

The script permanently reshapes the system, including disabling SSH login for the root user and resetting its password. There’s no uninstaller, so only run it on a clean system with nothing else on it:

curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | sudo bash

After the First Boot: Activation and Setup Wizard

Open https://YOUR-PI-IP in your browser. With option B, hostname -I on the Pi shows the IP address; with option A, check the device list in your router, or try https://nextcloudpi.local. NCP uses a self-signed certificate on your home network, so your browser will warn you – that’s normal, accept it. The activation page shows the user ncp and two passwords: one for the NCP panel and one for Nextcloud. Save both and click “Activate”. After that, Nextcloud itself is at the same address; log in as ncp with the Nextcloud password.

Next, a wizard walks you through the basics: it can move your Nextcloud data to a USB drive (the “Format USB” option wipes the drive), helps with port forwarding, sets up a dynamic DNS address, and gets a certificate from Let’s Encrypt. For dynamic DNS, the wizard itself suggests FreeDNS; No-IP works there too. You handle everything else in the NCP panel on port 4443 (https://YOUR-PI-IP:4443) or in the terminal with sudo ncp-config. The key setup options are letsencrypt, duckDNS and nc-datadir (storage location, which you can change later); backups and updates are covered further down.

After Installing: Change the Password and Create Users

Log in to Nextcloud. With AIO, the user is admin and the password is the initial one from the panel. With NextcloudPi, it’s ncp and the Nextcloud password from the activation page. Change that password right away: click your profile picture in the top right, then “Personal settings” and “Security”. Don’t use the admin account for everyday work. Create a regular user for yourself under your profile picture → “Accounts”. You can add an account for each family member the same way.

Setting Up Remote Access

To reach your files when you’re away from home, you need two things: an address that always points to your home connection, and port forwarding on your router.

  1. Address: With AIO that’s the deSEC domain from step 5, and AIO keeps it up to date. With your own domain or a dynamic DNS address, you need to keep it pointed at your current IP address yourself – many routers can update dynamic DNS addresses for you. With NextcloudPi, the easiest option is the dynamic DNS address from the wizard (FreeDNS); if you prefer DuckDNS, set it up under duckDNS in the NCP panel or in your router.
  2. Port forwarding: Forward these ports on your router to your Pi’s IP address (our beginner’s guide to port forwarding shows how):
PortAIO with a deSEC domainAIO with your own domainNextcloudPi
443 TCPYes – Nextcloud itselfYes – Nextcloud itselfYes – Nextcloud itself
443 UDPYes – used by Talk (video calls); AIO says to forward itOptional – enables HTTP/3 (faster)No
3478 TCP + UDPNoOnly with Talk (video calls)No
80 TCPNo, don’t forward itNo, don’t forward itYes – needed for Let’s Encrypt to verify your domain

Why Talk uses different ports: with the deSEC domain, Caddy sits in front of Nextcloud as a proxy, and AIO moves Talk traffic to port 443. With your own domain, Talk connects directly over port 3478.

Never forward the admin interfaces on your router. That means port 8080 for AIO and port 4443 for NCP. With AIO, also leave ports 80 and 8443 closed: they would give the AIO panel a valid certificate and expose it to the internet, which the AIO developers themselves advise against.

Where to find this on your router: It’s usually under Port Forwarding, NAT or Virtual Server. Some routers can also keep a DuckDNS address up to date – the FRITZ!Box, for example, takes DuckDNS’s update URL in its dynamic DNS settings. With NextcloudPi, use either the router or the NCP panel for this, not both. On an AVM FRITZ!Box (common in Germany and parts of Europe), port forwarding is under Internet → Permit Access → Port Sharing.

Away from Home Without Port Forwarding: Tailscale or Cloudflare Tunnel

If you want access on the go without opening a port on your router, use Tailscale: a VPN that’s free for personal use and connects your devices directly – see our guide to securing your Pi for internet access. A Cloudflare Tunnel technically works, but it has real limits with Nextcloud: uploads that aren’t split into chunks (for example from WebDAV apps that can’t do this) are capped at 100 MB on the free plan. Large uploads through the web interface can fail too, because Nextcloud uploads in 100 MiB chunks by default. On top of that, Talk’s built-in TURN server doesn’t work. That’s why Nextcloud itself recommends deSEC or Tailscale for AIO.

Connecting Your Phone and Computer

On your computer, the Nextcloud desktop client keeps a folder in sync with your cloud, much like Dropbox or OneDrive. For your phone, there are official apps:

The first time you open the desktop client or the app, enter your Nextcloud’s address and sign in. The desktop client opens your browser for the login. If you run NextcloudPi without a domain, enter https://YOUR-PI-IP and accept the prompt about the self-signed certificate. Turn on auto upload in the app menu, and new photos and videos upload to your cloud automatically. In the Android app, tap “Sync” on a file to keep a copy on your phone, so it opens even without a connection. If you only use Nextcloud on your home network, the app and client only sync while you’re at home.

Setting Up Backups

Always keep your backups on a different drive from your Nextcloud data. Mount the backup drive the same way as described in our USB hard drive guide; in our example it’s mounted at /mnt/backup.

Nextcloud AIO: AIO has a built-in backup feature based on BorgBackup. In the panel under “Backup and restore”, enter the folder, for example /mnt/backup, confirm with “Submit backup location”, then click “Create backup”. AIO encrypts the archive with a password that it shows in the backup section (after the first backup, under “Reveal your encryption password for backups”). Write it down, because you can’t restore without it.

After the first backup, expand “Click here to reveal all backup options”. Under “Daily backup and automatic updates”, enter a time – AIO uses UTC – and confirm with “Submit daily backup time and settings”; automatic updates are ticked by default.

To restore, use “Restore selected backup” in that same expanded section. If the whole system is gone, start AIO again with the same docker run command or nextcloud.yml as before and choose “Restore former AIO instance from backup” on the first page – you’ll need the backup folder and the password.

NextcloudPi: In the NCP panel, set up regular backups under nc-backup-auto. Turn on “Active”, enter the folder on the backup drive under “Destination Directory”, for example /mnt/backup/ncp-backups, and turn on “Include data” – it’s off by default, and without it NCP only backs up the Nextcloud installation with its settings and the database, not your files. To restore a backup, use nc-restore in the panel.

Keeping Your Nextcloud Running

  • Updates: The AIO panel tells you when an update is available. Stop the containers there, create a backup and click “Start and update containers”. When you turn on daily backups, automatic updates are ticked by default. Nextcloud releases a new major version roughly every four months (most recently Nextcloud 35 in September 2026), and each one gets updates for a year. NextcloudPi updates NCP itself automatically if the wizard turned that on when you set up dynamic DNS; otherwise enable it under nc-autoupdate-ncp in the panel or update by hand with nc-update. To update Nextcloud itself, run nc-update-nextcloud, or turn on automatic updates with nc-autoupdate-nc. NCP only moves up to the Nextcloud version the project has approved, currently Nextcloud 34.
  • Home Assistant: The “Nextcloud” integration shows stats from your cloud as sensors, such as active users, number of files and free storage. In the other direction, Home Assistant can store its backups straight in your Nextcloud via the “WebDAV” integration. Our article on Home Assistant backup & restore covers the other backup locations it supports. You’ll find more Home Assistant projects in our Home Assistant hub.

Frequently Asked Questions about Nextcloud on the Raspberry Pi

Is a Raspberry Pi 4 enough for Nextcloud?

Yes, a Pi 4 with 4 GB of RAM and an SSD over USB 3.0 is enough for a private cloud with a handful of users. With Nextcloud AIO on a 4 GB Pi, we recommend keeping Talk, Imaginary and Whiteboard on and leaving the ClamAV virus scanner, full-text search and Talk recording off – each needs roughly 1 GB extra. A Pi 5 with an NVMe SSD is noticeably faster, especially with photos and previews.

Does Nextcloud run on a Raspberry Pi 3?

We don’t recommend it. Nextcloud AIO needs at least 2 GB of RAM once you add optional containers, and the Pi 3 only has 1 GB. The NextcloudPi image is only available for the Pi 4 and newer, and on a Pi 3 the drive is stuck on slow USB 2.0. For your own cloud, a Pi 4 or Pi 5 is the better choice.

Nextcloud AIO or NextcloudPi – which one should I choose?

Choose Nextcloud AIO if you use Docker or are happy to: it’s the official method and comes with updates, backups, Office and Talk built in. NextcloudPi is the right choice if you’d rather avoid Docker – as a pre-built image for the Pi 4 and Pi 5, or as an installer on a fresh Raspberry Pi OS.

Do I need my own domain for Nextcloud?

With Nextcloud AIO, yes, even on your home network – it doesn’t support running on an IP address alone. You don’t have to buy one: AIO registers a free dedyn.io subdomain with deSEC from the setup screen. On your home network, NextcloudPi also works with just the IP address, but your browser will warn you about its self-signed certificate.

How do I back up my Nextcloud on the Raspberry Pi?

Nextcloud AIO has a built-in backup feature based on BorgBackup: point it at a folder on a second drive, create the first backup, then turn on daily backups and write down the encryption password. With NextcloudPi, nc-backup-auto in the NCP panel handles it, but you have to turn on “Include data”, or your files won’t be backed up. Either way, always keep the backup on a different drive from your data.

Which Nextcloud version runs on the Raspberry Pi?

Since version 15, Nextcloud AIO installs the current major release right away – at the moment that’s Nextcloud 35, released in September 2026. NextcloudPi 1.59 ships Nextcloud 34 and only updates to versions the project has approved. You can update Nextcloud from the NCP panel or turn on automatic updates there.

Similar Posts