Dr. Sharath Puttichanda was an emergency-medicine psychiatrist at Rhode Island Hospital in Providence in December 2019 when he stumbled across Sundeep Dosanjh’s Instagram posts from Machu Picchu.

A neighbor was off on an adventure in Peru while he was stuck home in wintry New England, Dr. Puttichanda (left) said, so he began wandering on the internet. “I was jealous,” he said.

Mr. Dosanjh’s Instagram posts were loaded with hashtags that included #gayindian. There he found more than just vicarious travel adventures.

“He had this beautiful post about his coming-out story,” said Dr. Puttichanda, 38 and the assistant director for psychiatric emergency services at Rhode Island Hospital in Providence. “I read that and I remember telling two of my best friends, ‘There’s this guy, and he had this beautiful story, and there’s something so familiar about him that I feel the need to reach out.’”

He didn’t. Instead, he began following Mr. Dosanjh, 36, on Instagram.

So a few weeks later, when Mr. Dosanjh posted a story about a Lyft driver’s off-handed, offensive remark about his ethnicity, Dr. Puttichanda posted a fiery comment noting that he also had had similar experiences.

“I responded, then looked at his pictures,” said Mr. Dosanjh, a web and communications specialist for the school district in Elk Grove, Calif. “He’s cute, and I followed him back, and we started bantering.”

Dr. Puttichanda had a break coming up, and Mr. Dosanjh suggested that he take a red-eye to San Francisco, so that the two might meet.

But Dr. Puttichanda had tickets to a Broadway show, so, instead, he all but brought Mr. Dosanjh along on his trip to New York, via FaceTime. He narrated every event, and the two were still on FaceTime together until both fell asleep.

Credit…KamReh Vision

Dr. Puttichanda says that it was that weekend that he knew he was in love.

Mr. Dosanjh remembers a pivotal moment from their third FaceTime conversation.

“I said, ‘I don’t know what’s going on between you and I, but I have to let you know that I can’t leave Northern California,’” he said. “He was like, ‘OK. I have nothing holding me back.’ And my heart literally melted.”

The first actual meeting between the two was still more than a month in their future.

With 3,000 miles separating them, they had to be creative about “dates.” For their first, each went to a local P.F. Chang’s, and fired up FaceTime to experience dinner almost as if they were in the same place.

“We had first-date conversation, looked at the menu together, everything you would do on a real in-person date,” Mr. Dosanjh said. “We had to think out every single detail to make it work.”

They had a second virtual date at the Cheesecake Factory shortly afterward. Mr. Dosanjh sent flowers to Dr. Puttichanda for Valentine’s Day. At the end of February, Dr. Puttichanda flew to San Francisco for an 11-day holiday, and Mr. Dosanjh surprised him at the baggage carousel.

“We kissed,” Dr. Puttichanda said, “and in that moment, I let everything go.”

The two were married Sept. 25, in a wedding that began with a Sikh Punjabi ceremony at the Sheldon Inn, a restaurant in Elk Grove, Calif. Jasminder Singh, a cousin of Mr. Dosanjh who became a Universal Life minister for the event, oversaw the signing of the civil marriage license.

On Sept. 26, the couple had a second ceremony, at the home in Elk Grove of Mr. Dosanjh’s family, that followed the traditions of Dr. Puttichanda’s family, who are Kodava and from the Karnataka state of Southwest India.

The couple had solved the problem of the continent between them with the purchase of a condominium in Sacramento, and Dr. Puttichanda’s decision to take a job there.

“Every single moment we chatted, I was just, ‘Oh my gosh, I think this is it,’” Mr. Dosanjh said. “It didn’t matter the distance, it didn’t matter the time difference. I’d found my person.”