He was the son of Captain Molter Christoph Gerlach of the Schleswig Hunters Corps and Anna Sabine Magdalena née Boehn.
In 1827 he married Caroline Marie Kromayer (1800-1846), who in the marriage gave birth to eight children, one of whom died in infancy.
In 1858 Gerlach became a member of the advisory committee of the Ministry of War and in 1859 he was appointed Inspector General of the Infantry.
When the Second Schleswig War broke out in 1864, he was given command of the 1st Division,[3] which pushed the Prussians back at Mysunde on 2 February.
[5][page needed] In connection with the memorial services on 18 April 2014, descendants of Gerlach gave a journalist insight into documents that, among other things, showed that Gerlach was a stronger critic of government policy than people assumed; but for reasons of principle he chose to comply with the government's order to hold the Dybbøl position, even though he found it erroneous on the basis of a military assessment.