Pihl returned to Norway in 1850, and started working for the road office at the Norwegian Ministry of the Interior, but by 1851 he was hired as an engineer on Norway's first railway, the Hoved Line, where he worked on the section from Christiania to Lillestrøm. After completion of the line in 1854 he moved back to England for a year, but later returned to work on the Telemark Canal, and subsequently as county engineer in Akershus. In 1855, Pihl proposed building pumping stations and gasworks in Skien. Since he was the most prominent railway engineer in Norway at the time, he was hired in 1856 to work on the projects for several of the early railways in Norway, the first being the Kongsvinger Line, the Hamar–Grundset Line and the Trondhjem–Støren Line. In 1858 the office of "Statens Jernbaneanlægs hovedkontor" was created to manage the state railways, and Pihl was hired as its director.