Set the Instant Pot mode to sauté, adjust to normal and set timer to 20 minutes. Add the unsalted butter.
3 lb unsalted butter
In about 5-6 minutes the butter will start to melt.
Soon the entire butter will melt and start to bubble.
Soon the residue will start to settle at the bottom and the top will become frothy. Stir intermittently.
Keep boiling for another 8-10 minutes and test if the ghee is cooked. To check, add 2 tablespoon water to the boiling ghee. If it sizzles immediately, the ghee is cooked. Else cook for another 2-3 minutes and test again.
Once the ghee is cooked, stir once and shut off the Instant Pot.
Add salt (if using) and mix well.
¼ teaspoon salt
Though the pot is off, the heat is enough to make the residue turn dark brown and settle. So do not remove the insert yet. We want the milk solids to be dark brown, not black. So if they start to darken a lot, remove the pot and set aside.
Let the ghee cool in the Instant Pot insert and transfer to a clean bottle through a fine mesh strainer.
Cover and store at room temperature. This Instant Pot ghee can be refrigerated too (though not required).