I set up a personal Nextcloud instance
So, I set up a Nextcloud instance last week.
I’ve been thinking about doing it on and off for a while. On the one hand, I don’t really need a Nextcloud instance. I don’t have all that many files I want to put on it. But on the other hand, it seems really neat. Nextcloud can do a lot of things: file storage, sure, but also kanban, and RSS feeds, and a calendar, and a lot more.
Veronica Explains recently made a post about how to setup vimwiki with Nextcloud Notes, and I wanted to try it out. I was actually looking into a way to get vimwiki synced when that post came out.
What I’m Replacing #
So, I don’t really use cloud storage that much. I stash a bunch of files I want to keep (but that I don’t need immediate access to) on OneDrive, Dropbox, and Google Drive. But I don’t really use them regularly.
For syncing between devices, I usually use Syncthing. Syncthing is really nice, since it’s entirely peer to peer. There’s no central server that holds everything. Every device syncs directly with each other. This makes it really convenient to set up. But there are some issues: namely Android[1] keeps killing it, which causes it not to sync. Plus, while I would like files to be accessible on my phone, I don’t necessarily want them to always be saved on my phone.
The Setup #
So, the computer I’m using for this is an old Dell tower PC from 2012. This was my parent’s old computer. It’s been sitting in a box for years, since it’s not very good (at least, not at running Windows…). It has a 512GB HDD, 4GB RAM, and 2 core Pentium CPU @ 3GHz. It should be good enough for the task of running Nextcloud.
I was thinking of maybe trying out Fedora Core for the OS on it, because I have Fedora on most of my computers. But, I decided to just go with Ubuntu Server. Keep it simple.
I saw NextcloudPi, and thought “Hey, maybe I could get Nextcloud working on this Raspberry Pi instead!” I have a Raspberry 3B+ that I’m not doing much with, and NextcloudPi claims that Raspberry Pi 3+ are supported. If I could get Nextcloud working on it, that would be great. This is bait. It’s a trick. Don’t fall for it. You can install it, and it will work, but it will crash after like 5 minutes no matter what you do. Luckily, I left a warning for myself, so I didn’t get tricked.

Installing Ubuntu Server is much like installing Ubuntu. There’s a really nice TUI installer that takes you through all the steps. At the end of the installer, there’s a page that shows you popular server snaps you can add. One of them is Nextcloud. I’m not the biggest fan of snap, but I figured why not? If I didn’t use the snap, I was probably just going to use the Docker image instead. (It’s probably for the best that I didn’t, as it seems that my use case of a local only instance isn’t supported by the AIO docker container.)
And that’s it! I didn’t need to do anything else! Installing the snap gives you a complete working Nextcloud instance out of the box. I’m sure the snap has some downsides for more advanced usage, but for my needs it seems perfectly fine.
Accessing the Instance #
So, I’m going to have this instance running locally in my home. I’m not going to expose it to the internet; it’ll only be accessible from the local network. I can use the local IP to access it directly, but I’d like to be able to get access it through the hostname.
I use the names of Pokémon trainers for the hostnames on my devices. This way, each device has a unique and memorable name that I can use to identify it, rather than using random IDs or model numbers. My Nextcloud instance is named Cheren (because my Raspberry Pi is named Bianca). The address I’d like to use is cheren.local
.
Getting this working is a little harder than I’d want, but it is technically possible. The .local
TLD is reserved for Multicast DNS. mDNS is cool, but it’s also a pain. mDNS just works for some things (for example, ftpd on my Nintendo 3DS uses mDNS, so I can use ftp://3ds-ftpd.local:5000
instead of my 3DS’s IP), but if it doesn’t Just Work, then I can’t seem to get it to work at all…
I tried using Pi-Hole to set a local DNS entry for cheren.local
, but this is inconsistent. It works on Android and Windows, but Linux refuses to make DNS requests for .local
domains. This is actually correct behavior; Everything else is doing it wrong. .local
is reserved for mDNS, so it shouldn’t make a DNS request for them. But it is annoying.
There is a simpler way to get something similar to what I want, using DHCP. The DHCP server is essentially what assigns IP addresses to devices that connect to the network. It also can make devices accessible on the local network from their hostname. You can access a device with <hostname>
or <hostname>.<local domain>
. (The local domain is a domain name that’s used to refer to your local network. It’s provided by your DHCP server. I think some might let you set it to whatever you want, but my router just pulls it from my ISP.)
While I was trying to get everything working, I was looking at the network logs in Android using NetGuard. I noticed some requests going to cheren.<local domain>
. Accessing cheren.<local domain>
takes me to the Nextcloud page! So, then I fell down a rabbit hole of what this is, and why it’s working. At first I thought it might be something that my ISP does, but the fact that the local domain is from my ISP is just a coincidence…
I also noticed that this doesn’t work when using Pi-Hole. It turns out that when I change the DNS settings on my router to point to Pi-Hole, local hostname resolution stops working. To get it working with the Pi-Hole, I need to set “Conditional Forwarding” in Pi-Hole. This forwards requests for for bare hostnames, local domains, and local IPs to the DHCP server.
The format for the setting is:[2]
# true - enabled
# 192.168.1.0/24 - local IP range in CIDR notation
# 192.168.1.1 - IP of DHCP server (in my case, the router)
# <local domain> - the DHCP server's local domain
true,192.168.1.0/24,192.168.1.1,<local domain>
Anyway, with this all set up, I can now access the server through cheren/
or cheren.<local domain>
! I guess it wasn’t technically necessary, but I learned a bit about DNS and DHCP, and it looks nicer to have my account show up as arnaught@cheren
instead of arnaught@<local IP>
.
Tangent: Pi-Hole #
So, I didn’t actually have Pi-Hole set up before I started this. I only set it up to try and see if I could get the .local
domain working with DNS.
I like Pi-Hole. DNS adblockers certainly don’t block everything, but they do a decent job at cleaning up ads and trackers when you can’t use uBlock Origin. It can remove ads from Android apps, and a couple streaming services for some reason.
I switched to the Hagezi Multi PRO DNS Blocklist. Before, in NetGuard, I was just using the default, Steven Black Hosts.
Nextcloud Notes (and Joplin) #
So, I imported my vimwiki into Nextcloud Notes, and it works as described. Nextcloud Notes seems like a good notes app for Android. The only thing I don’t really like is that it doesn’t support wiki link syntax (i.e. [[link]]
). There were a couple issues about it, but it doesn’t look like it’ll be added because it’s not standard markdown. Disappointing, as one of the best things about vimwiki is being able to easily link to different pages. The rest of it is great, though.
Setting up Joplin is also pretty simple. In the Joplin app, you just have to set the sync method to Nextcloud, and add the URL and credentials for the webdav interface. Before, I had it syncing with Syncthing. That worked fine, but Android keeps closing the Syncthing background service. I figure it might be a better experience to have the syncing done directly through the Joplin app instead.
Document Editing #
So, in order to edit Office documents through Nextcloud, you have to use a document server. Collabora Online - Built-in CODE Server is a Nextcloud app that enables the Collabora Online server (which is based on LibreOffice). Once installed, I can edit odt documents from my Nextcloud in the browser! However, when I tried it in the Nextcloud mobile app, it seemingly just spins forever (I later realized that this was due to DNS shenanigans, as described in a previous section.).
I also tried the ONLYOFFICE Document Server instead, and that also works. The CODE server seems to only support odt, while ONLYOFFICE seems to only support docx. (Well, ONLYOFFICE has an option to enable odt support, but it has a warning that it isn’t fully compatible. I didn’t find an option to enable docx support in CODE, but maybe I missed it.) ONLYOFFICE also doesn’t support mobile web editing on the free version.
However, neither of these are actually necessary for what I want. The document server is only necessary for web editing. On desktop, I can just use LibreOffice like normal, and on mobile I can use the ONLYOFFICE app or the Collabora app. No document server required, unless you need web editing.
After using it for about a week, I think I really like the Collabora app. The ONLYOFFICE app is okay, but it does something to prevent Gboard from putting spaces after words when using swipe typing, which makes it frustrating to use.
Whiteboard and Draw.io #
Draw.io is a really cool flowchart application. It’s entirely web based, but there is a desktop app (it’s just a Chromium wrapper). It’s been my go to for making flowcharts. You can add it to Nextcloud with no problem! Since Draw.io is a web app anyway, accessing it through the browser is perfectly fine.

Excalidraw is a similar app. It’s for whiteboarding instead of flowcharts, but these do have some overlap. This can be added to Nextcloud, but it’s branded as Nextcloud Whiteboard. It seems to be exactly the same as Excalidraw, except for the file extensions. You do need to install an additional server for this, though.
There is no desktop app for Excalidraw, as far as I know, but since it’s web based, it doesn’t really matter.
Deck #
Nextcloud Deck is a pretty cool kanban app. I find a kanban to be the most helpful type of todo list. I used to use Trello a lot, but then the limited the free boards.
Personally, I’m surprised that there don’t seem to be any(?) offline kanban apps. All of them seem to use a server. Surely it can’t be that hard to save the board to a single file?
eBooks #
So, I use Moon+ Reader Pro for reading offline epub eBooks on Android. You can sync the library and reading progress using WebDav, so I set that up to use Nextcloud!
There’s also an EPUB Viewer app for Nextcloud that lets you open epubs from inside Nextcloud’s web interface. It doesn’t integrate with Moon+ Reader at all, but it’s a decent app for viewing epubs. (The best epub reader is, of course, Foliate!)
Backing Up Screenshots #
For my desktop, I just moved my Pictures/Screenshots
folder into Nextcloud, and set up a symlink. It works perfectly fine. The desktop client takes care of everything.
On Android, I can just enable camera upload in the Nextcloud app.
For my laptop console, I wanted to have my Steam screenshots automatically added to my Nextcloud. This way, I would have easy access to them, even if it’s turned off.
First, I need to get all the screenshots in a single folder. I accomplish this with a simple script:
#!/usr/bin/env bash
SRC="$HOME/.local/share/Steam/userdata/<USER ID>/760/remote"
DEST="$HOME/Steam Screenshots"
find "$SRC" -type f -name "*.jpg" -exec cp -vn {} -t "$DEST" \;
Then, I need to upload it to the server. I tried doing this with rclone, but it’s absurdly slow (at least on the initial sync; it’s better if the remote folder is already populated). The Nextcloud client is way faster. However, there is no way to get the Nextcloud client running in the background in gaming mode.[3] With the nextcloudcmd
command, however, you can sync a single folder. This is pretty much all I need; I don’t need to sync everything to this computer, and I only really need to update it when I make changes. So, I wrote a simple script to sync a folder, and I have it set to run occasionally on a timer.
#!/usr/bin/env bash
USER="arnaught"
PASS="<PASSWORD>"
REMOTE_FOLDER="Devices/akari"
LOCAL_FOLDER="$HOME/Cheren"
NEXTCLOUD_URL="http://cheren"
flatpak run \
--command=nextcloudcmd \
com.nextcloud.desktopclient.nextcloud \
-u "$USER" -p "$PASS" \
--path "$REMOTE_FOLDER" \
"$LOCAL_FOLDER" \
"$NEXTCLOUD_URL"
(Akari is the hostname for my laptop console, btw.)
Offline #
So, I was kinda worried that I would need to expose Nextcloud to the internet. I was worried that it would be useless on my phone unless it’s constantly connected. But this isn’t true. Most apps support offline mode! Using Nextcloud Notes, or Deck, any changes you make will be saved offline and synced later when the connection is restored. Joplin works entirely offline, too.
I don’t need to have the instance always accessible, because it will just save what I’m doing to be synced later.
The official Syncthing Android app is discontinued. There’s a fork that’s still updated. Everything still works with the fork, but I just thought I should mention this. ↩︎
One more thing about this: the reason it needs the IP range is so that it can do reverse IP lookups. You can do a DNS lookup for a hostname and get the local IP, or you can do a DNS lookup for a local IP and get the hostname! This is actually how NetGuard was showing me the
cheren.<local domain>
requests, even though I never used that domain anywhere! ↩︎This may not be true. For the Syncthing GTK Flatpak, you can get it working by writing a custom service file for it. This may also be possible with the Nextcloud Flatpak, but I haven’t tried it. ↩︎