My Raspberry Pi Zero 2W is an excellent test platform for running self-hosted services with minimal system resources. Previously, it served as a media server with Plex and Jellyfin, and then evolved into a barebones cloud storage system with File Browser. However, File Browser lacked sync properties and was more of a web-based file management utility with remote playback, sharing, and download capabilities. So, I thought of switching to NextCloud, which is an entire self-hosted ecosystem in itself.

NextCloud is a traditional cloud storage alternative that you can use to store and sync your files to a local server. It had additional office apps, video conferencing solutions, and more, but I was focused on using it as a simple folder sync service. The Pi Zero 2W tried to hold its ground while acting as a cloud server, and worked better than I expected. Let's discuss the details below.

Setting up NextCloud on Pi Zero 2W

DietPi makes it effortless

NextCloud requires multiple services to function, including a web server such as Nginx and a database service like MySQL. If you are using a Raspberry Pi operating system like the Raspberry Pi Lite, you'll have to manually install and configure each service.

It doesn't end up well most of the time, which is why I prefer DietPi. Using its Software tool, I installed NextCloud from its official repository in a few clicks. I only had to pick a web server while installing, and I chose Nginx because it's considerably lighter compared to others.

After a long wait, the NextCloud installation completed without any errors. But the task wasn't done. Writing stuff to a micro SD card isn't ideal due to space constraints and the sheer stress on the tiny storage device.

So, I added an external SSD to the Pi Zero 2W and used the Drive Manager tool in DietPi to manage the mount process. It automatically scans the system for new USB drives, and then you can mount them using the menu. I did a quick speed test, and the results were within the permissible limit.

Next, I installed the NextCloud client on my Windows 11 PC, which wasn't too much effort at all. It's just a client that'll connect to the Pi Zero 2W’s NextCloud server, but you must configure it first.

Configuring NextCloud

Enabling local storage

On DietPi, NextCloud is auto-configured to some extent. I don't need to create a user and use the default credentials (admin, DietPi) to log in to the NextCloud account. You can access it by typing the Pi Zero 2W's IP address/NextCloud in the browser.

The dashboard was launched with dummy files and folders because we hadn't set up anything related to cross-device sync or a storage drive to access files. But I added the connected SSD drive using the settings.

To do that, open the Apps option under the profile icon options and look for External storage support. It's disabled by default, but since we don't want to use the micro SD card, I enabled it. After that, you'll find an External Storage option under the Administrative section.

Name your storage and pick the local option from the list. Enter the mount path, which is usually the mnt directory. In my case, it's /mnt/SSD (I named my drive SSD while mounting it). Enter your administrative account credentials, and the local storage will appear in the Files section. Wait for it to scan all the files and create thumbnails.

Accessing local storage and setting up file sync

Don't use the SD card for sync

The local storage is already available in the NextCloud dashboard. I opened it and tried browsing the files. However, it seemed to be too much for the Pi Zero 2W, as I could only see the list but not open any of them. It took forever to load the thumbnails for images and videos, and the video playback suffered some stuttering. Since the SSD had a lot of files, NextCloud became very sluggish in responding to playback and preview tasks in the first run.

It worked fine after that, but I didn't find it as seamless as File Browser, which had better playback controls. You can download files, and the feature didn't encounter any roadblocks on my other devices, like my phone or Linux laptop.

Thereafter, I launched the Windows client and added the IP address of the NextCloud device. I picked the HTTP version because I use it locally. Then I added a new Folder Sync Connection, which simply picks the folder you want to sync across devices. I added the Documents folder on my Windows PC, but went with the default location for the first time.

The sync happened immediately due to the low number of files and folders, and the changes appeared on the NextCloud server. On DietPi, the synced folders live in the mnt directory in the DietPi_Userdata folder. I'm surprised that there's no way to learn about it on NextCloud’s web portal. I had to use the DietPi Dashboard’s File Explorer tool to view the mnt directory contents and find the sync folder.

I created another Folder Sync Connection for the SSD and synced a screenshot folder from my work. It had a lot of images, but the sync completed with decent upload speed. I even tried syncing large video files, and those worked fine. You might have to change some permissions to alter the file size limit while syncing them. It's 500MB by default.

You can add as many Folder Sync Connections as you like, and each one of them will appear in the mnt directory on the Pi. Like OneDrive, NextCloud lives in the system tray and syncs the new files when it detects them. You can force it to scan and sync, but it worked fine in my tests.

You can access the synced folders in File Explorer, and the mounted USB drives also appear as network drives there. So, you can download the files onto your PC when needed. Another great idea is to use Tailscale on the Pi to make the NextCloud server accessible outside your network.

A budget NextCloud server

Pi Zero 2W can handle the NextCloud file sync and storage without problems. But it pushes it to its limits. With a meager 512MB of memory, it becomes impossible to do any other task. Even SSHing into the Pi becomes slow when the sync is active. I had to pause sync on my PC to access the Pi SSH terminal and did many restarts to relaunch everything.

However, most of the slowdowns I experienced were with the web interface of NextCloud and not the file sync. It doesn't break all the time, but I would prefer another simple tool for File browsing. That said, I can now sync my important files from the C drive without worrying about internet disconnections or service outages.