There’s a bit to explain here. So the root user is basically the equivalent of Administrator. One big difference (there are many) is that when you run something as root using sudo, you are actually running as the root user. When you ran the first command to create the folder, you created it in your home directory using the ~ shorthand variable which points to your /home/ user folder. The second command, also references your home folder. However since your running as root, it’s looking for the file in the root user’s home directory or /root, not your home folder.
The config file needs to be in the home directory of the user running the command unless you can put the full path to the config file in the command, then you can put it wherever you want.
The usual go to for self hosted password managers is VaultWarden. There’s no deb or rpm package but you can get it spun up with docker pretty easily. Any reason you’re specifically looking for “included” or packaged solutions? That’s going to severely limit your options.