You’ll need to have Firefox installed on the machine, even if you don’t use it. We’re going to borrow its Native Messaging component and use it in Librewolf.
ln -s ~/.mozilla/native-messaging-hosts ~/.librewolf/native-messaging-hosts
sudo ln -s /usr/lib/mozilla/native-messaging-hosts /usr/lib/librewolf/native-messaging-hosts
Now, in KeePassXC settings, go to Browser Integration and select the Advanced tab.
Check the box for: Use a custom Browser Configuration Location
Set Browser Type to Firefox
Enter the following in Config Location: