Nils Hansteen was born in Mo i Rana, in the county of Nordland, Norway. He first attended a technical college in Trondheim to study mechanical engineering. He subsequently attended the Bergslien School of Art where he studied under Knud Bergslien and Morten Müller during 1873 and with Peder Cappelen Thurmann at the Royal Drawing and Art School. He later studied under Hans Gude in Karlsruhe (1876 to 1877) where Gude led him into marine painting and greatly influenced his artistic development. He later lived in Munich (1877–1880) and Italy (1880–1881). In 1881, he came back to Norway, and was resident in Christiania (now Oslo) until his death, except the period 1887 to 1892 when he stayed in Copenhagen. Was a member for Norway of the exposition committee at Nordic Exhibition of 1888.