Wright began constructing fortifications around Washington, D.C., before being assigned to the 3rd Division of the Department of Northeast Virginia under Maj. Gen. Samuel P. Heintzelman. Serving as Chief Engineer of the 3rd Division during the First Battle of Bull Run on July 1, 1861, Wright was promoted to major in August. Promoted to brigadier general of volunteers the following month, Wright was assigned as Chief Engineer to Maj. Gen. Thomas W. Sherman's November 1861 expedition against Port Royal, South Carolina. His successes while commanding Union troops in operations against Jacksonville, St. Augustine, and other military targets on the Florida coast from February to June 1862 led to his appointment as major general of volunteers and commander of the Department of the Ohio in August 1862, and commander of the newly created Army of the Ohio in March 1863. In this command he played a major logistical role in the repulse of Confederate General Braxton Bragg's invasion of Kentucky in 1862. His appointment as major general was not confirmed by the Senate and was revoked in March 1863. As a brigadier general, he was not considered eligible to command a department and Maj. Gen. Ambrose Burnside was sent to relieve him. Reporting to Burnside, Wright remained briefly as the commander of the District of Western Kentucky before returning to the East.
In May 1863, Wright was given command of the 1st Division in the VI Corps of the Army of the Potomac under Maj. Gen. John Sedgwick. His first battle in division command was Gettysburg in July 1863, where his corps was held in reserve. The corps saw action at Mine Run in November 1863, and the Battle of the Wilderness on May 5 to May 6, 1864. After General Sedgwick's death at Spotsylvania Court House on May 9, Wright assumed command of the VI Corps, receiving promotion as major general of volunteers (confirmed by the Senate this time) and brevetted colonel in the regular army on May 12, 1864.
Wright's corps fought at Cold Harbor from June 3 to June 12, 1864. In the Valley Campaigns of 1864, he was dispatched to Washington, D.C., to defend against Confederate Lt. Gen. Jubal Early's raid on July 11 and July 12, 1864, commanding the Washington Emergency Defense Force, consisting of the VI, VIII, and XIX Corps. During the defense of Fort Stevens, he gained notoriety by inviting President Abraham Lincoln to join him on a parapet exposed to enemy fire. (A young lieutenant, Oliver Wendell Holmes, was responsible for yelling at the president to get under cover.)
Wright commanded the VI Corps again during Maj. Gen. Philip H. Sheridan's Shenandoah Valley campaign from August 6 to October 16, 1864. Wright directed fighting at Cedar Creek on October 19 before General Sheridan's arrival.
In the Siege of Petersburg, the VI Corps was the first unit to break through the Confederate defenses, on April 2, 1865. Subsequently, operating under the command of Sheridan, it defeated Confederate forces at Sayler's Creek on April 6, 1865, resulting in the capture of a large number of Confederate soldiers, including Lt. Gen. Richard S. Ewell. For Wright's actions at Petersburg he was promoted to a brevet major general in the regular army.
During Reconstruction, Wright commanded the Army of Texas from July 1865 to August 1866. He was promoted to lieutenant colonel of engineers in November, before leaving volunteer service in September 1866. He was involved in a number of engineering projects including the Brooklyn Bridge and the completion of the Washington Monument. Promoted to colonel in March 1879, Wright was later named Chief of Engineers as a brigadier general in June 1879. He retired at that rank on March 6, 1884, and lived in Washington, D.C., until his death in 1899. He is buried in Arlington National Cemetery under an obelisk erected by veterans of the VI Corps, facing the Washington Monument he completed.
The city of Fort Wright, Kentucky, is named in his honor. The fort—an earthwork structure—was planned during the Confederate invasion of Kentucky in the summer of 1862 while Wright was in command of the Department of the Ohio; the fort was completed in 1863.