in october 1810, gawler obtained a commission as an ensign in the 52nd (oxfordshire) regiment of foot and in january 1812 went to the peninsular war. he was a member of a storming party at badajoz, and was wounded and saved from death by a soldier who lost his own life. he was in spain until 1814, taking part in the advance on madrid. the regiment returned to england and gawler, now a lieutenant, fought at the battle of waterloo. he remained in france with the army of occupation until 1818, and in 1820 married maria cox of friar gate, derby who was the niece of samuel richardson. gawler's new sister-in-law, mary ann, married william leeke, a fellow officer from the 52nd. gawler and his wife were sincerely religious and when the 52nd was sent to new brunswick in 1823 they did much social and religious work. gawler returned to england in 1826 and from 1830 to 1832 was engaged in recruiting. he reached the rank of lieutenant-colonel in 1834 and in 1837 received the royal hanoverian guelphic order (kh), third class.