Zoneminder is a pretty solid setup for IP security cameras, and the zmninja app is really nice too. I had tried it years ago but got back to it recently with some sketchy IP cameras. I just put them in their own VLAN, no Internet access, Zoneminder does motion detection and event recording, and so far I’m quite pleased with it.
Windows users will want to check out BlueIris
Otherwise, Synology has a great surveillance package, but you only get 2 cameras licenses with your NAS and more licenses are like $50 each