He was born in Lambayeque on April 3, 1823. His parents were the American merchant Juan Fanning and Micaela García Durán. He married to Teresa Gonzales del Real in 1853. He entered the service as Third Pilot in December 1839, being the pailebot "Vigilante" the first ship in which it served. In 1844 he graduated as Midshipman, and during the Government Board presided by Domingo Nieto, comprised the staff of the corvette "Limeña". During the government of Ramon Castilla, he participated in the expedition to the Amazon River from 1851 until August 1853, when he returned to Callao to embark on the brig Gamarra to the United States to help several compatriots. By the "gold rush," migrated to California without success. That year Fanning reached the rank of Lieutenant Junior Grade. Returning to Peru, being already Lieutenant Commander, served again in the "Gamarra", this time like its executive commander. In 1855 marks the end of the government of General Jose Rufino Echenique, who was defeated in the battle of La Palma on January 5 by the forces of General Ramon Castilla. This is made the command of the Republic, and immediately Fanning is discharged for the support he offered to Echenique, until 1860, when he assumed the captaincy of the port of Cerro Azul. He was also captain of the ports of Huanchaco and Pisco, between 1864 and 1866.