Canby was a colonel at the start of the Civil War. He helped defeat a Confederate force during the New Mexico Campaign in early 1862. At the end of March 1862, he was promoted to Brigadier general. He was reassigned to the eastern United States. In 1864, he became commander of the Union forces along the Gulf of Mexico. He captured the Confederate city of Mobile, Alabama in April 1865.