Outdoor space is a luxury. And, if you’re lucky enough to have it, you may only have enough room for a few potted plants and maybe a bench.

But some New Yorkers go bigger.

Think a beekeeping operation that yields fresh, hyperlocal honeycomb, or a personal putting green — right outside your back door.

As summer starts, here are some of the coolest ways urban cowboys have tricked out their private oases.

Out on a limb

Artist Melinda Hackett, 54, built a circular treehouse behind her West Village townhouse for her three daughters. (That was after she purchased the historic 19th-century home from David Byrne of the Talking Heads in 2004. She paid $5.8 million, according to public records.)

Hackett’s oldest daughter, Herron Hutchins, said her mom built the spacious playland when the family moved to the house on West 12th Street from North Salem, NY — to make up for taking the kids out of the country.

“It doesn’t feel like you’re in New York City,” Hutchins says. “It’s just wood walls [with] a tree right up the middle.”

The three daughters — now all in college at ages 18, 21 and 23 — still use the treehouse when they come home for visits. It’s so big, Hutchins says, that adults can easily stand up inside; about eight people can comfortably sit. The treehouse, now decorated with colorful fabrics and a disco ball and used for quality hangout time, has always been a draw for friends, particularly in what she calls the tough “awkward stage” in middle school.

“It definitely gained some cool points for us when we were younger,” she adds.

The treehouse wasn’t as popular with the family’s neighbors, however, who called the authorities on Hackett several years ago, claiming the structure wasn’t legal. But Hackett prevailed when, in 2010, she got approval to keep the treehouse from the city’s Landmarks Preservations Commission.

Diamond in the rough

When Jofie Ferrari-Adler, 41, decided to transform his tiny Windsor Terrace back yard into a personal putting green as a 40th birthday present to himself, there was a big problem to fix.

“The first thing I had to do was catch the raccoons,” which had torn up the grass, he says. It was an ordeal, but he managed to deter the varmints from the property around his house.

He then called up Michael Lehrer of Home Green Advantage, who installs custom greens all over the tristate area. Lehrer put in the “tiny” turf area last year, Ferrari-Adler says, which at its largest has “probably a 12-foot putt” and four holes.

But that’s just enough for the book editor and former golfer, who got his start playing at a public course in rural Pennsylvania as a 10-year-old, then continued playing seriously through college.

“I’m a golf nerd who doesn’t really get to play anymore because I live in New York and I have kids,” he says. But now, he can get on the green pretty much every day when the weather’s good.

“It’s so nice that you can just step outside your back door and spend 10 minutes hitting some chips or doing some putting,” he adds. “For me, it’s like therapy.”

And it’s becoming something of a family affair: His 8-year-old daughter, Mabel, and 5-year-old son, George, are getting into it, too.

“It’s really fun,” he says. “They’re out there all the time.”

All the buzz

Josh Deeter, 40, has made good use of the outdoor space at his home in Corona, Queens. In the back yard, he has a grill, a garden and a bike shed — and on the roof, he’s created a welcoming home for a swarm (or two) of bees.

After an apprenticeship through the New York City Beekeepers Association, Deeter and his girlfriend, Adrienne Cichelli, have tended hives full of honeybees for about three years.

Initially inspired by friends in California, Deeter is glad he picked up the hobby. Other than the obvious perk of fresh honeycomb, he says caring for bees gives him a sense of satisfaction similar to “whatever it is that inspires someone to do gardening-type work.”

Deeter is hoping to populate his hives with one of the wild swarms that typically appear in New York this time of year, alarming city dwellers when they take over trees, settle on roofs or hang off street signs. It’s because the swarms are relocating.

“The queen will say, ‘OK, it’s time to go.’ She’ll take half the bees of the hive, and in mid-spring, they’ll just leave the hive en masse. Sometimes that could look like a basketball-sized cluster of bees, or it could look like three large pizzas on the side of a roof,” says Deeter. “It happens all over New York pretty much all spring.”

Through the grapevine

Upper East Sider Latif Jiji has a claim to fame: His back yard (and roof) contain the only vineyard on the island of Manhattan.

The 90-year-old retired City College mechanical engineering professor carefully tends tangled vines, planted in 1977 in the dirt behind his townhouse, that now extend four entire stories up to the roof. And every year in early fall since his first harvest in 1984, he — with the help of a small, multigenerational army of family and friends (his wife is also 90) — has turned the green Niagara grapes into bottled white wine on the premises.

“It’s washed, crushed, pressed [and] turned into juice all here in one day,” he says. The whole process occurs in the townhouse basement, where Jiji has a tool called a “crusher de-stemmer” and a self-made storage system.

Jiji keeps some of the wine for himself and his family, and gives the rest away. Everyone who helps with the bottling and hand-painting of the bottle’s labels — the vineyard’s name, Chateau Latif, is a play on the famous French winery Chateau Lafite — gets to take some home.

And, surprisingly, there’s a lot to give. The skinny vines laid over a makeshift lattice of metal tubes, bamboo rods and wood strips bear a large load of fruit, depending on the season’s sun and rain.

“The record is 712 pounds” harvested in 2009, Jiji says, which produced “about 200 bottles of wine.”

Though Jiji has been making wine out of his home for decades, the inspiration for the vineyard has an even longer history. As a boy, Jiji helped cultivate grapevines planted by his father at their family home in Basra, Iraq. When he first planted his vines in New York, it was to “duplicate something I liked as a child.”

Adds Jiji, “I wanted to reach the sky.”