He was the eldest of the sons of Hans Christoph Ernst von Gagern. He was born at Weilburg on 24 October 1794. He entered the University of Göttingen, but soon left, and, taking service in the Austrian army, took part in the Russian campaign of 1812, and fought in the following year at Dresden, Kulm and Leipzig. He then entered the Dutch service, took part in the campaigns of 1815, and, after studying another year at Heidelberg, was member for Luxembourg of the military commission of the German Federal Diet (1824, 1825).