After attending the Wiener Neustadt Military Academy, Wilhelm Ramming was appointed in October 1834 as a lieutenant in the Cuirassier Regiment No. 7, with whom he served for the next five years. On 30 November 1839, he became a lieutenant in the staff of the General Quartermaster. He was promoted to captain on 20 June 1845. During the First Italian War of Independence he served under FML Haynau and participated in the attack on Brescia and the siege of Fort Malghera, as well as in the battles against the insurgents at Pieve di Cadore. On 4 June 1849, he was appointed lieutenant colonel.