He became commanding officer of the sidewheel gunboat in 1863 for operations in the South Atlantic Blockading Squadron. In 1864 he took command of the monitor and became heavily involved in the blockade of Charleston, South Carolina, operating for seven weeks inside Charleston Roads on picket duty and in support of Union Army forces, and engaging in almost constant shelling of Confederate forces at Fort Sumter and on Sullivan's Island. He also served as senior officer at Stono Inlet, South Carolina, in joint operations with Union Army forces, frequently engaging Confederate forces at short range. He commanded the steamer in the East Gulf Blockading Squadron from 1864 to 1865. Cooper commanded the sidewheel gunboat on special service from 1866 to 1867. Promoted to captain on 2 December 1867, he was stationed at the Norfolk Navy Yard from 1867 to 1869. From 1869 to 1871, he commanded the screw frigate , the flagship of the Asiatic Squadron. When Korean shore batteries fired on two ships of the squadron in the Salee River on 1 June 1871 and Koreas Joseon Dynasty did not answer an American demand for an apology, "Colorado", with squadron commander Rear Admiral John Rodgers and United States Minister to China and Korea Frederick Low aboard, was among five warships which participated in the Korean Expedition of 10–12 June 1871; the ships landed a force of sailors and U.S. Marines on Ganghwa Island and in the Battle of Ganghwa on 10 June 1871 attacked and captured several Korean forts, inflicting large casualties on the Korean defenders with minimal American losses. In 1872, Cooper again served at the Norfolk Navy Yard, and from 1873 to 1874 he was in command of the ironclad . He was promoted to commodore on 5 June 1874. He was commandant of the Pensacola Navy Yard at Pensacola, Florida, from 1875 to 1876, then was a lighthouse inspector from 1876 to 1877. He served as President of the Board of Inspection and Survey from 1877 until March 1880. He was commandant of the New York Navy Yard from 1 May 1880 to 1 April 1882, and was promoted to rear admiral on 15 November 1881. Cooper was ordered to command of the North Atlantic Squadron in 1882, at one point attending the unveiling of a statue of George Washington at Caracas, Venezuela. He also commanded five ships of the squadron on a visit to New York City, where they anchored in the East River for the opening ceremonies for the New York and Brooklyn Bridge – now known as the Brooklyn Bridge – on 23 May 1883; all ships manned the yards and joined the New York Navy Yard and other nearby military installations in firing a salute to the new bridge.