Civil War soldiers endured a lot of horrors: fighting fellow Americans, long waits for medical care, primitive living conditions, and the food. The food was awful, being limited to what a soldier could carry, and rations relied heavily on dry, insect-laden hardtack.
The boys in Union blue also got dried navy beans and, occasionally, a "treat" of sorts: dehydrated potatoes, fruit and other items the soldiers jokingly called "desecrated" vegetables (perhaps because their flavor violated the laws of nature?). At least the North had coffee — though it was a brew "you probably wouldn't recognize in New York," as 16-year-old Union soldier Charles Nott wrote home. "Boiled in an open kettle, and about the color of a brownstone front, it was nevertheless ... the only warm thing we had."
Confederate soldiers weren't so lucky: Union blockades kept coffee, flour and other goods from reaching the South. Those jonesing for a cup of joe had to make do with substitutes brewed from peanuts, chicory, rye, peas, dried apples — pretty much anything they could get their hands on.