BALTIMORE — Maj. Gene Hogg, the Salvation Army’s commander for central Maryland, organized mobile kitchens after the twin towers fell in Manhattan and the levees broke in New Orleans. He fed protesters and police officers during the riots that erupted here in 2015 after a young man named Freddie Gray died of injuries he received while in the back of a police van. More than 200 businesses were destroyed, many of them places where people bought food.

Once the city calmed down, he pondered his next move. After three days of prayer and fasting, Mr. Hogg had an answer.

“God said I needed to open a grocery store,” he said.

It wasn’t exactly what he had hoped to hear. What Mr. Hogg , 56, knew about grocery stores he could have scribbled on the back of receipt.

Now, three years later, he can talk about produce and Pop-Tarts like a pro. On a recent Friday afternoon he bounded around the aisles of DMG Foods, a bright, 7,000-square-foot, nonprofit grocery store, showing a customer with a baby how to print a coupon and encouraging another to try the freshly ground chicken.