Having once endured a galley fire aboard a boat I can tell you there is nothing worse. We were fortunate that an old wool blanket was close at hand and allowed us to smother the fire before the entire boat went up.
Based on that experience we have fire extinguishers in each cabin/compartment aboard our boat--including heads--positioned near the doors so they are in easy reach; and, one in the sail locker that opens in the cockpit. We have a CO2 Extinguisher in the main cabin and we keep a Fire Blanket on the inside of the door opposit the Galley. (See TheFireStore.com: Kovenex Rapid Response Blanket: Kitchen (7oz, 37"x34")
. For the little cost, a Fire Blanket is worth its weight in Gold. One must, however, conduct fire drills once in awhile to keep everyone aware of where the gear is and how to use it.
We also have a Fireboy automatic extinguisher positioned in the Engine Room. While costly, these do give us a good discount on our insurance.