Sign up for our special edition newsletter to get a daily update on the coronavirus pandemic.

Brent Underwood learned a tough lesson: Don’t spend millions on a ghost town in which you wouldn’t want to self-isolate.

The 32-year-old marketer took sheltering in place to the next level when he became trapped in a California ghost town he recently purchased. The problem is: There’s no running water and a snowstorm has him trapped.

Plus, it may be haunted.

“When I first got out here, I was in a T-shirt and enjoying myself,” Underwood tells The Post. “And then it snowed for four days straight and now there’s no way to get out.”

He bought Cerro Gordo, a former silver mining town with a murderous history, for $1.4 million in 2018. Aside from monthly visits, Underwood has largely left it in the care of its full-time live-in caretaker of 21 years, Robert Desmarais.

When the scope of the coronavirus pandemic became clear, Underwood agreed to take over duties for a week while Desmarais checked in on his wife in Arizona. But that was about a month ago.

Now, he’s stuck in his ghost town under five feet of snow.

“In the absolute worst-case scenario, there’s snowshoes here, and the road is 7 miles long down a steep hill,” he says. But that will only get him to a 35-person town without grocery stores, and he’s found himself out of breath after snowshoeing for just several yards. The closest town with a grocery store is 26 miles away.

He’s been melting snow for water and while he’s out of bread and vegetables, he has enough rice and canned tuna to get him through until the snow thaws.

He remains in good spirits for now, but a different type of spirit is giving him trouble.

Underwood says he was aware of the 22-building town’s violent reputation when he bought it, adding that it once had one murder per week. A TV show called “Ghost Adventures” once investigated the town and found that it was haunted by the ghosts of two children who died after being trapped in a closet.

“I stay in the room with the child ghosts,” says Underwood, “but I have yet to see them.”

But that doesn’t mean spooky things aren’t happening in Cerro Gordo during the lockdown.

“Things are moving around, I’m seeing curtains move, I’m hearing things in the night,” he says. “There’s no draft, but things drop inside of houses.”

In addition to a general ambiance of otherworldliness, a light in the bunkhouse keeps turning on, and his wallet recently disappeared for two days only to reappear in the town hotel.

“That was a bit freaky,” he admits, but he believes the spirits are peaceful. “For the most part, I leave the ghosts alone and they leave me alone,” Underwood says. “I try to respect their space.”

“Anytime you’re in a town and expect to see nothing and hear nothing, when you do, your mind is on heightened alert,” he adds.

Despite all the jitters, Underwood finds the town beautiful, and the prospect of returning to society is not wholly appealing.

‘“If I don’t look at my phone or my computer, it’s like nothing happened,” he says. “When I do look at the news and I see how chaotic and terrible things are, there’s a part of me that isn’t in a huge rush to reenter the world.”

He also takes strength from the town’s history, knowing it’s weathered similar storms. “It’s been through many pandemics,” including Spanish influenza, he says, “and it’s still standing.”

Underwood is passing the time fixing up and finding artifacts on the property, going on hikes and remotely managing his five employees in Austin, Texas via satellite internet — occasionally consulting with a pair of crows Desmarais named Heckle and Jekyll.

“If I’m working through something at work, I’ll tell Jekyll about it,” he says. “I think I talk to myself through talking to the animals.”

He plans to return to Austin to quarantine when he’s able to, but in the meantime, he feels as though he’s done a proper job of secluding himself from humanity, and the virus currently wreaking havoc on it.

“As the world is trying to isolate themselves, there’s not much further isolation you can do than an abandoned ghost town,” he says. “I’m trying to embrace it.”