MIKE BARRETT does not have much of a yard at his two-story row house in Astoria, Queens. But that fact has not kept him from his new hobby of beekeeping  he put the hive on his roof. When it was harvest time this fall, he just tied ropes around each of the two honey-filled boxes in the hive, and lowered them to the ground.

Eventually, Mr. Barrett loaded the boxes into his car, took off his white beekeeper suit and set off for a commercial kitchen in Brooklyn. There, along with other members of the New York City beekeeping club, he extracted his honey, eventually lugging home 40 pounds of the stuff.

He was happy with his successful harvest, but he also reaped something he did not expect. “I was surprised how much I really care about the bees,” said Mr. Barrett, 49, a systems administrator for New York University, in reflecting on his inaugural season as a beekeeper. “You start to think about the ways to make their lives better.”

Until last spring, Mr. Barrett would have been breaking the law and risking a $2,000 fine for engaging in his sticky new hobby. But in March, New York City made beekeeping legal, and in so doing it joined a long list of other municipalities, from Denver to Milwaukee to Minneapolis to Salt Lake City, that have also lifted beekeeping bans in the last two years. Many towns, like Hillsboro, Ore., have done the same, and still other places, like Oak Park, Ill., and Santa Monica, Calif., are reconsidering their prohibitions.