Homelab

Moving My Nextcloud to a VPS: Hardening, Surprises and Backups That Pull Home

December 4, 2026 · 6 min read · John Crump
Diagram: phone and laptop reach Nextcloud on a VPS over HTTPS only; the homelab pulls the backup from the VPS with read-only rsync and stores it on the NAS

Last night I moved my Nextcloud off a container in the homelab and onto a small VPS, so I can reach my files from anywhere without opening anything on my home network. I did it the same way I’ve been doing most homelab work lately: I told Claude what I wanted, did the clicks only I can do, and let it handle the rest. It took one evening, and it turned up more surprises than I expected from a “fresh” server.

The fresh VPS wasn’t ready for the internet

The first thing Claude did after I added its SSH key was a read-only look around. The brand new server already had:

  • root login with a password allowed over SSH
  • remote desktop (xrdp) listening on the public internet
  • no firewall at all, and no fail2ban
  • mDNS exposed for no reason

Bots find open RDP and password SSH within minutes, so hardening came before anything else. One sensible catch: the only key on the box was Claude’s, so it wouldn’t turn off password logins until I’d added my own key and proven I could get in. Otherwise the only way back in would have been the provider’s web console.

After hardening, the box allowed SSH by key only, had a firewall open to just SSH and HTTPS, ran fail2ban on SSH and installed security updates automatically. RDP and mDNS were no longer reachable from outside.

Two provider surprises

The first attempt to install packages just hung. The cause was the provider’s DNS servers, which weren’t answering at all. The box could reach the internet by IP address but couldn’t look up a single name. Pointing it at public resolvers fixed that.

That also explained the next oddity. Package downloads complained that the repository files were “not valid yet”, because the clock was five hours off. The time service couldn’t look up its servers either. Once DNS worked, the clock synced and everything installed normally.

Nextcloud All-in-One, with the admin panel kept private

For the install I used Nextcloud All-in-One, the official Docker setup. It bundles the database, Redis, HTTPS with automatic Let’s Encrypt certificates and its own updates. Two details mattered:

  • The admin panel only listens on the server itself. I reach it through an SSH tunnel, so it’s never on the internet.
  • Docker gets around the firewall. A port published by a container skips ufw entirely. So the rule is simple: never publish a container port that should stay private. That’s also why I left Nextcloud Talk off; its call port would have opened a hole.

For extras I picked Nextcloud Office (Collabora) and Imaginary for fast photo and PDF previews. I skipped full-text search and virus scanning, which would eat RAM on a 2-core box that only one person uses.

One small head-scratcher: Claude’s first test of the admin page got “Forbidden”. AIO only accepts requests that carry the headers a real browser sends, so command-line tests get turned away. In a browser it worked first time.

My own DNS fooled the AI

When I said the DNS record was in, Claude checked and told me it wasn’t there, even when asking Cloudflare’s nameservers directly. It was there. My firewall quietly redirects all DNS traffic on the LAN to my own Pi-hole, even queries addressed to Cloudflare, so every check was really asking my home DNS. Running the same check from the VPS, outside my network, showed the record was fine.

There was a second layer to it. Claude’s very first lookup happened before I’d created the record, and my home resolver cached the “doesn’t exist” answer for half an hour. So the site worked from my phone on cellular before it worked from my own couch. The lesson for anyone with split DNS: test public records from outside your network.

Backups: home pulls, the VPS never pushes

A server on the public internet shouldn’t have any way into my home network. So the backups run in the opposite direction from what you might expect:

  1. Every night at 1 AM, Nextcloud AIO makes an encrypted, deduplicated BorgBackup on the VPS and then updates itself.
  2. At 3:30 AM, one of my Proxmox hosts reaches out to the VPS and copies the backup onto a share on my NAS.

The key the home server uses can only do one thing on the VPS: a read-only rsync of the backup folder. It can’t open a shell or touch anything else. The copy job also has a few guard rails:

  • It skips a run if a backup is still being written.
  • It refuses to sync if the backup on the VPS has vanished or suddenly shrunk to less than half of the copy at home, so a wiped or compromised VPS can’t wipe my NAS copy too.
  • The NAS share is mounted on demand and lets go when idle, so a sleeping NAS can’t hang the Proxmox host.

The first copy landed on the NAS in about 17 seconds. It’s still encrypted with a password that only I have, so the NAS copy is useless to anyone who gets hold of it.

Swapping it in and retiring the old one

With the new instance up, Claude pointed my Homepage dashboard tile and my Uptime Kuma monitor at it. The dashboard widget uses a read-only stats token instead of my password. Then came the cleanup for the old instance: it came out of the nightly Proxmox backup job, its reverse proxy host was disabled, and its local DNS records were removed. Every change was backed up before it was made.

Bonus: messaging the homelab from my phone

Earlier in the evening I also set up a way to reach Claude when I’m away from home, even when my desktop is asleep. My Linux jump box now runs an always-on Claude Remote Control server, and I pick it from the Claude mobile app. Its sessions start in a folder of their own with their own instructions, not in the shared repo my other AI agents can write to. That way nothing another agent commits can change how my phone sessions behave. A cron watchdog restarts it after a reboot or crash.

And one small quality-of-life fix for the AI team: a canceled label for my issue inbox. If I add it to an issue, none of the agents will touch it, and Claude closes it within 10 minutes. It only counts if I’m the one who added it.

What I’d tell you to check on your own VPS

  • Look at what’s listening (ss -tulpn) before you install anything. Fresh doesn’t mean locked down.
  • Check DNS and the clock. If either is broken, package installs and certificates fail in confusing ways.
  • Remember that Docker-published ports skip ufw.
  • Add your own SSH key and test it before turning off password logins.
  • Back up by pulling from home, with a key limited to read-only, so a compromised server can’t touch your LAN.
  • If your network redirects DNS, test public records from outside it.

The whole move took one evening. My part was the account clicks only I can do: the DNS record, the NAS share and the passwords. Claude did the rest, and it kept asking before anything that could lock me out or expose something new.

Leave a Reply

Your email address will not be published. Required fields are marked *