Porter began naval service as a midshipman at the age of 10 years under his father, Commodore David Porter, on the frigate . For the remainder of his life, he was associated with the sea. Porter served in the Mexican War in the attack on the fort at the City of Vera Cruz. At the outbreak of the Civil War, he was part of a plan to hold Fort Pickens, near Pensacola, Florida, for the Union; its execution disrupted the effort to relieve the garrison at Fort Sumter, leading to Sumter's fall. Porter commanded an independent flotilla of mortar boats at the capture of New Orleans. Later, he was advanced to the rank of (acting) rear admiral in command of the Mississippi River Squadron, which cooperated with the army under Major General Ulysses S. Grant in the Vicksburg Campaign. After the fall of Vicksburg, he led the naval forces in the difficult Red River Campaign in Louisiana. Late in 1864, Porter was transferred from the interior to the Atlantic coast, where he led the U.S. Navy in the joint assaults on Fort Fisher, the final significant naval action of the war.