If a fire pit is legal in your area, your fire department will most likely discourage placing it on a deck or a porch or putting it too close to a building. The Brigantine Beach fire department in New Jersey, for example, recommends keeping fire pits at least 15 feet from a building and five feet from any combustible material. Fire departments also generally frown upon leaving an outdoor fire unattended.
Local regulations will generally forbid using fire pits at apartment buildings of three or more stories. Even if your local laws don't include such a restriction, ask yourself if it's really a good idea to have an open flame on your sixth-floor balcony, especially since half of all grill-related home fires begin on a balcony or unenclosed porch, accoring to firesafety.gov.
Burning trash and items that emit noxious odors is generally prohibited.
While laws probably won't cover certain safety considerations, it is probably a good idea to follow some of these common guidelines: Don't use your fire pit during high winds; put a non-combustible device under your fire pit to catch embers and hot ashes; don't use gasoline, kerosene or other starter fluids that might cause a rapid flare-up; and wait for all the ashes to cool before disposing of them, or else douse them with plenty of water first.