Several mineral railways were constructed around Dunfermline in western Fife, Scotland, in the eighteenth century and later. Their purpose was to convey minerals to market from the outcropping coal deposits that had encouraged industrial activity in the area from an early date.
Several waggonways were built: the Fordell Railway, the Elgin Railway, the Halbeath Railway and others, with the objective of connecting collieries and quarries with harbours on the Firth of Forth. The Elgin Railway carried passengers from 1833 and formed the core of the Charlestown Railway and Harbour company, and finally in 1856 the West of Fife Mineral Railway was founded to build new lines. The Charleston and West of Fife companies combined to form the West of Fife Railway and Harbour.
All the lines have ceased to exist, except that a short section of the Charlestown line forms part of the Inverkeithing to Dunfermline line.