1630s, from German Sauerkraut, literally "sour cabbage," from sauer "sour" (from Proto-Germanic *sura-; see sour (adj.)) + Kraut "vegetable, cabbage," from Old High German krut, from Proto-Germanic *kruthan.
In U.S. slang, figurative use for "a German" dates from 1858 (cf. kraut). "The effort to substitute liberty-cabbage for sauerkraut, made by professional patriots in 1918, was a complete failure." [Mencken]. French choucroute (19c.) is from Alsatian German surkrut (corresponding to German Sauerkraut), with folk etymology alteration based on chou "cabbage" + croûte "crust" (n.).