History of rail transport in Germany could be traced back to 16th century. The earliest form of railways, wagonways were developed in Germany in 16th century. Modern rail history officially began with the opening of the steam-hauled Bavarian Ludwig Railway between Nuremberg and Fürth on 7 December 1835. This had been preceded by the opening of the horse-hauled Prince William Railway on 20 September 1831. The first long distance railway was the Leipzig-Dresden railway, completed on 7 April 1839.
The forerunner of the railway in Germany, as in England, was to be found mainly in association with the mining industry. Mine carts were used below ground for transportation, initially using wooden rails, and were steered either by a guide pin between the rails or by flanges on the wheels.
A wagonway operation was illustrated in Germany in 1556 by Georgius Agricola (image right) in his work De re metallica. This line used "Hund" carts with unflanged wheels running on wooden planks and a vertical pin on the truck fitting into the gap between the planks to keep it going the right way. The miners called the wagons Hunde ("dogs") from the noise they made on the tracks. Such wagonways soon became very popular in Europe.
From 1787, a network of wagonways, about 30 kilometres long, was also built above ground for the coal mines of the Ruhr in order to streamline the daily transportation of coal to loading quays on the River Ruhr. As elsewhere the railway network in the Ruhr was horse-drawn, and was not available to the public as transport. Some of these tracks were already using iron rails - hence the German term for railway, Eisenbahn, which means "iron way". The Rauendahl Incline () in Bochum (1787) and the Schlebusch-Harkort Coal Railway () (1829) are examples of railways from those early days that can still be seen today. From 1827-1836, a wagonway was also built in Austria and Bohemia from Budweis to Gmunden via Linz.