The Big Apple’s homeless now run on Dunkin’.

The NYPD recently launched a program that uses hot cups of Dunkin’ Donuts coffee to try to lure vagrants off the subways and into shelters, The Post has learned.

Cops and homeless-outreach workers are staffing a makeshift java bar inside the World Trade Center subway station, where they serve up free cups of joe to riders who spend their nights snoozing on the E train.

The pilot project, which was coordinated with the MTA, could be expanded elsewhere if it proves successful, law-enforcement sources said.

The Post watched from midnight Saturday to 4 a.m. Sunday as about 15 homeless people sipped coffee inside the former workshed near a walkway to the opulent, $4-billion Oculus transit hub next door.

None accepted the offer of a taxpayer-funded cot, and about half were let back onto the platform free of charge by cops who either swiped a MetroCard at a turnstile or held open the gate.

“It was a pleasure meeting you! Have a nice day!” a female cop told one man lugging a cart and two shopping bags full of stuff.

Despite the dismal success rate, the cafe could turn into a popular stop for the hobos who’ve turned the E train into a sleeping-car haven, due to its smooth benches and 50-minute, Manhattan-to-Queens route that never goes above ground.

“They ask you a bunch of questions. They want your name, and I don’t like that,” said one man who refused to go to a shelter after downing a cup of java.

But the man noted that the “coffee was very good,” adding: “I would come back if I was waiting for the train.”

In a cruel twist, the homeless people weren’t allowed to help themselves to several tray-sized boxes of doughnuts inside the room, with an officer explaining that they didn’t want the pastries making their way back onto the subway platform.

That order disappointed at least one man who approached several cops outside, saying: “Where the doughnuts at?!”

“I always know there’s doughnuts where you guys hanging out!” he added.

Another man, Avan Cherry, said he was sleeping on an E train when cops rousted him and escorted him to the cafe.

“Half these officers know me, locked me up already. Centre Street ain’t too far away,” he said, referring to the location of Manhattan Criminal Court.

Straphangers said they welcomed any efforts to rid the E train of homeless people, with Telford Watson of Queens calling the current situation “ridiculous.”

“There’s always no seats because they’re sprawled out all over,” he said.

Watson, 36, also said he’d learned to avoid seemingly empty cars because that means “there’s a homeless person laid out on the bench sleeping, fumigating the whole car.”

Gustavo Burroughs, 58, of Queens, also complained about the “disgusting” stench of some homeless riders.

“I’ve been taking it over the past four months, and I think it’s getting worse,” he said.

“I feel like I’m getting sick every morning.”

NYPD Assistant Commissioner J. Peter Donald said: “The Department is continually finding new ways to address persistent quality of life issues. The homeless conditions — which are not crimes — in the subway system is no different.”