I plan to selfhost nextcloud, for now just for bookmark sync. is there a point to installing a vpn on the computer running the instance? it shouldnt matter as long as i have https right? what about if i dont have a domain? i cant have https without a domain (ill buy one later just want everything to work first). or maybe use one of those free domain providers for now to get https? what do you guys think?
I have a few comment to your post and the other panic about security.
Using nextcloud only for bookmarks if total over kill, but if you want to start and understand and later use it more, it's actually a good idea.
Yes, exposing ports in your firewall is potentially dangerous, BUT if you only expose a port and not the complete PC the firewall deals with attacks (but your services still have to be up to date to ensure safety).
Yes, using a VPN instead of exposing the service is saver that's for sure. You can do it they way for the start. But don't let you be frightened by some of the other commands. I have several services public on my network.
3.1. BUT I still evaluate if this service even have to be public and the risk of late patches. I have public services and local service (name.domain.com and name.local.domain.com). Any service that I don't need to access from a random PC/share with family/friends can only be accessed in local network /via vpn.
Its good you are careful, try to search online for more information since this post didn't get a lot of comments.
Edit:
5. Don't know why people recommend tailscale where you need an account, instead of recommendatinh wireguard (tailscale is build on wirequard) or OpenVPN.
Edit 2:
6. Don't use UPnP! It enables your machines to automatically open ports, that's so bad.
Attack surface is the ports and services you are exposing to the internet. Keep this as small as possible to reduce the ways your setup can be attacked.
Network topology is the layout of your home network. Do you have multiple vlans/subnets, firewalls that restrict traffic between internal networks, a DMZ is probably a simple enough approach that is available on some home grade routers. This is so if your server gets breached it minimises the amount of damage that can be done to other devices in the network.
If you don't understand these terms, you probably shouldn't be exposing any kind of port on your router. Seriously, not being snarky.
I used to teach multiple levels of Cisco classes, and I wouldn't expose a port these days, I don't know enough.
Instead, I'd recommend using Tailscale on a home machine and your mobile devices.
Using Tailscale, you can also selectively expose a service to the wider world (not just devices running Tailscale), using the Funnel feature.
I'd say it's your safest intro to accessing self-hosted resources from just about anywhere.
Edit: a couple years ago I opened a port helping a friend test something, I forget what. Within hours I was getting hammered with thousands of requests per hour, people trying to break in.
I wasn't worried because of the security we had, but it was annoying, and potentially a massive risk.