Graduating as candidate.jur. in 1846, he received a government grant in 1852 for education in forestry. He travelled around the country between 1855 to 1860, providing the grounds to establish a national forestry authority. This was established in 1860, and Barth became district chief in Kristians Amt.
He published several books
He was the father of forester Agnar Johannes Barth (1871–1948).