He secured a posting as a second lieutenant with the United States Army Corps of Engineers. He worked on improvements to New York Harbor. He was assigned to the building of Fort Delaware. McPherson then directed worked on fortifications on Alcatraz Island in San Francisco Bay. In 1858 he was a first lieutenant. In 1861 when the Civil war broke out, he raised a company of volunteers to fight for the Union. Now a captain went to Boston to supervise the construction of harbor defenses. His former commander helped him by making McPherson his Aide-de-camp and promoted him to Lieutenant colonel.