Upon the outbreak of the Civil War, he left California, and entered the Confederate service.
He was appointed on March 16, 1861 as a Confederate lieutenant of engineers.
He resigned from the U.S. Army on June 29, 1861.
He soon became chief engineer on the staff of General A. S. Johnston as a lieutenant colonel.
Gilmer was severely wounded in his right arm at the Battle of Shiloh, where Johnston was killed.
After his recovery in Georgia, Gilmer was promoted to chief engineer of the Department of Northern Virginia in early August 1862.
He was stationed at Richmond with the rank of brigadier general.

On August 25, 1863, Gilmer was given a temporary appointment to the grade of major general.
He was appointed Chief of the Engineer Bureau for the Confederacy.
He spent time overseeing the defenses of Charleston, South Carolina, although he was still plagued by recurring health problems from his Shiloh wound.
Concerned that the vital rail and manufacturing center of Atlanta would be targeted by Union forces, he commissioned Atlanta businessman and entrepreneur Lemuel P. Grant to develop a plan to ring the city with forts and earthworks along all the key approaches.
These elaborate defenses would prove difficult to seize in frontal assaults, forcing the Union army to lay siege to Atlanta in the summer of 1864.

Gilmer helped improve the defenses of Mobile, Alabama, in June and July.
He returned to Richmond in July 1864 and spent the rest of the war there as Chief of the Engineer Bureau.
Upon the outbreak of the Civil War, he left California, and entered the Confederate service. He was appointed on March 16, 1861 as a Confederate lieutenant of engineers. He resigned from the U.S. Army on June 29, 1861. He soon became chief engineer on the staff of General A. S. Johnston as a lieutenant colonel. Gilmer was severely wounded in his right arm at the Battle of Shiloh, where Johnston was killed. After his recovery in Georgia, Gilmer was promoted to chief engineer of the Department of Northern Virginia in early August 1862. He was stationed at Richmond with the rank of brigadier general.
On August 25, 1863, Gilmer was given a temporary appointment to the grade of major general. He was appointed Chief of the Engineer Bureau for the Confederacy. He spent time overseeing the defenses of Charleston, South Carolina, although he was still plagued by recurring health problems from his Shiloh wound. Concerned that the vital rail and manufacturing center of Atlanta would be targeted by Union forces, he commissioned Atlanta businessman and entrepreneur Lemuel P. Grant to develop a plan to ring the city with forts and earthworks along all the key approaches. These elaborate defenses would prove difficult to seize in frontal assaults, forcing the Union army to lay siege to Atlanta in the summer of 1864.
Gilmer helped improve the defenses of Mobile, Alabama, in June and July. He returned to Richmond in July 1864 and spent the rest of the war there as Chief of the Engineer Bureau.
Jeremy Francis Gilmer