self hosted mongodb

Hello, i'm trying to self host my db on the vps ubunto server..
may i ask is there is any way to do that in which me and the docker containers only can have access to that db? from the ip address maybe?
also what's the pros and cons of self hosting my db? what should i take care of before doing that.
Was this page helpful?