Just did a quick Google… There are some resources and tutorials online of people doing exactly that. Take a look!
Only thing you might need to change is the configuration for which port the pi-hole web server (UI) will be running on. Because octoprint already uses Port 80 by default, you might have to assign another port for the pi-hole service. (I believe it also defaults to 80. That would crash because it can’t bind to the same port). That should be a pretty simple config change though.
Out of the box, pihole has a few block lists already set up. Those are pretty good already.
To add more, you can find some good block list collections online. No need to add them all. Pick a good handful, depending on the category of stuff you want to block. Here are some helpful links:
https://github.com/lightswitch05/hosts
… Once you got a few block lists set up, you’ll probably want to whitelist some things specifically, that are otherwise caught up in the filter. This is a super helpful resource for that:
https://discourse.pi-hole.net/t/commonly-whitelisted-domains/212
Posteo.de - 100% renewable energy. Full industry standard encryption. No tracking, no adds. Annual transparency report. Supporting social and environmental efforts. Great treatment of their employees.
Same here. Wireguard.