Many locals in Patchogue know Cory Mahony for his skills behind the bar at James Joyce Pub.

What most don’t know is after his late-night shifts, he heads a few blocks west in the village to a 1,000-square-foot building.

There, he takes his bartending gear off and begins his passion work as a hydroponic farmer.

For the uninitiated, hydroponics, known as vertical farming, is a growing style using technology to produce food in a “controlled, soilless setting,” according to the U.S. Department of Agriculture.

“With hydroponics, you use 90 percent less water than traditional farming and everything grows 50 percent faster,” said Mahony.

The 24-year-old first learned of the style while flipping through a Forbes Magazine article.

“I read about it a couple of years ago,” said Mahony. “I thought it was so cool, so fascinating.”

So he began doing his due diligence. He bought books and spent countless hours researching online.

He remembers the first thing he ever grew in his parents’ house in Holbrook.

“It was basil,” he said. “It actually came out really good.”

Then he made arugula. Then butterhead lettuce.

He shared his yield with his friends and family, and they all loved it.

“I felt I can do it after that,” he said.

Mahony told GreaterPatchogue that hydroponics is a forgiving style of farming because you can fine-tune the plants by adjusting nutrient levels, the light intake, and how acidic or basic crops are.

“You can ‘hack the plants,'” he said. “You can change the flavor profiles by changing these factors.”

After graduating from Stony Brook University with a degree in business and entrepreneurship, he began his work as a bartender. His goal was to stash away as much cash as possible so he could move his growing operations to a larger location.

After two years, Mahony found the perfect spot for his company, Urban Fields Agriculture, at 37 Bransford Street in Patchogue.

“It was 2 a.m. at [James Joyce] and a real estate agent was at the bar,” Mahony said. “She pulled out the MLSLI app, we saw the spot, and I checked it out first thing in the morning.”

He officially moved into the space three months ago.

He’s growing what made him famous amongst friends: basil, arugula, and lettuce. Mahony also grows nutrient-packed microgreens. And everything is organic and GMO-free, he says.

“You can grow anything, too,” added Mahony. “I’d like to stick to the leafy greens because they grow faster.”

Urban Fields Agriculture’s first harvest was last month.

He plans to sell his products to local restaurants and, eventually, nearby supermarkets.

Dave Chiarella, co-owner of PeraBell Food Bar in town, is a big fan of Mahony’s work.

“The basil is delicious and beautiful,” said Chiarella.

The Main Street restaurant uses the local farmer’s crops in its cocktails.

“We make a nice bourbon drink with them and named it the Urban Bourbon,” added Chiarella.

The Urban Bourbon at PeraBell

As he continues to grow his business, Mahony looks forward to supplying more nearby eateries with his freshly-grown products.

“There can be a blizzard outside and I am still coming with your locally, grown order,” said Mahony.

To learn more about Urban Fields Agriculture, click here.

Scroll down for photos.