Murphy was born in Westchester County, New York, and was appointed midshipman on August 10, 1841. He served during the War with Mexico at Vera Cruz and Tabasco on board the . He resigned as a passed midshipman on May 10, 1852, after his last mission as an assistant on John G. Barnard's survey of the Isthmus of Tehuantepec. He went into the private sector, working as a first officer on the Collins' line of steamships, a city surveyor for the city of New York, Chief Engineer of the Brooklyn Navy Yard, and lastly as a member of the New York State Senate (4th D.) in 1860 and 1861.