In my head cannon for the 26th century, every Federation Planet that has a significant population (7 digits worth of population as a minimum) has Multiple Layers of Planetary Shields like the ones we saw on Star Trek Picard. When I say multiple layers, I mean a minimum of 16 layers stacked at different altitudes above ground level. Every planet in the Federation needs to be able to fight off a Alien Invasion Fleet at the drop of a button, yet still allow traffic ingress if need be from Shuttles / StarShips / Transporter signals at a controlled rate.The thing is, these questions arise for more than just phasers. You know what's enormously more dangerous? Any spacecraft with an impulse engine. Even a mere shuttlecraft crashing into a planet at a high fraction of the speed of light would have a kinetic energy comparable to the asteroid that killed the dinosaurs. One drunk driver could cause an extinction-level event. For that matter, any warp-driven ship is an antimatter bomb waiting to go off. Stardrives are incredibly dangerous things, yet we've never seen any hint of restrictions on their private ownership and use. The fact that we don't see more accidental cataclysms suggests that most Federation citizens are really, really careful and responsible, and that the exceptions are identified early and prevented from gaining control of spacecraft (though things are probably looser out on the frontier where scoundrels like Harry Mudd operate). And that suggests there are similar safeguards in place where possession of less deadly things like hand weapons are concerned.
Every Star has layers of Sentry Satellites that are cloaked and constantly watching for any bad ships cloaked, or otherwise that might try to pull shenanigans on a Star. We don't want terrorists that use tech to artificially create a SuperNova on your local Star, that would be very bad. If it can happen in DS9, then it can happen anywhere at anytime.
Then there's StarFleet, and we need a Federation equivalent to the US Coast Guards which I've labeled as the PSG (Planetary System Guards) which specialize in patrolling around their Planetary Star System. These are off-course separate from your regular Space Police Force.
The ability to Own/Operate StarShip/Shuttle/'Space Car' should be similar to getting your private Pilots license. It takes time, but there will be more and more people who do it for business, personal, recreational, residential, or other reasons for people to own / live in space.