In the suburbs and cities you may not be legally allowed to do things like drill a well, or have your own sewage treatment, nor things like gardening or raising livestock. If you're lucky in that respect or willing to flout the law you still have the neighbors to deal with, not just "will they turn me in" but how different can you be before they turn on you? especially when they're feeling social stressors that you aren't?
If you want to do this for real, get rural.
On the other hand, small gardening and having as much nature as you can in a city is viable and fine and lovely; its just not going to be a winner in terms of feeding you or isolating you from the corner vegetable stand's supply issues. Nothing wrong with container grown salads and pride in them; but you're not shifting much of your food bill tot hat and the time investment will make the economics suck. You have to add in the personal joy of tending the garden to make it pay.
Rural life is the same but with much more "how does this make sense?" that can't be answered without intangibles on the accounting sheet.
Another (and for the majority of folks, probably better) option is to pursue a "neighborhood self sufficiency" model. This gets around a lot of the issues of local government getting in your way, because if you get enough neighborhood buy-in, then there's more you can get away with / make happen. A good place to start is the transition towns movement, which, though it can sometimes be a little new age / hippie for folks tastes, it really is trying to tackle all the things you talked about. Good luck! Whatever you decide, share it back (here, YouTube, whatever). Humans best feature is talking to each other about how to solve problems.
having a garden.
learning how to maintain the systems in your house (plumbing, electrical etc)