Place water, beans, onion, ketchup, molasses, mustard, Worcestershire sauce, bay leaves, salt and pepper into the Instant Pot.
Close the lid and set the Instant Pot to cook on HIGH PRESSURE for 30 minutes. At the end of the cooking time, allow the pot to rest undisturbed for 10 minutes. Then, release all remaining pressure.
Open the lid, and using the back of a spoon, mash a few of the beans to thicken, and serve.
You do need to soak the navy beans before cooking them, so you can either soak them overnight or soak them in hot water for an hour before you cook them.
You might be wondering, "How do you thicken Boston baked beans?" The trick is to mash some of the beans after cooking them in order to thicken it up. Just mash some up with the back of a spoon and mix it all together.
I made my recipe meat-free, but you can feel free to add some salt pork or bacon into the mix.
These beans actually freeze very well, so feel free to make an extra-large batch to freeze and enjoy later! Just make sure you let the beans cool before putting them in the freezer, as putting hot beans in the freezer can cause the beans to burst or the container they're in to crack.