The Edinburgh and Dalkeith Railway was an early railway built to convey coal from pits in the vicinity of Dalkeith into the capital. It was a horse-operated line, with a terminus at St Leonards on the south side of Arthur's Seat.
Opened in stages from 1831, it was Edinburgh's first railway, and used the track gauge of 4 ft 6 in, commonly used for mineral railways in Scotland. The entry into the terminus involved a passage through a tunnel on a rope-worked incline.
It was not planned for passengers, but a trader operated passenger services and they were surprisingly successful, and the company later operated them itself.
When intercity railways were being planned, the North British Railway wished to reach Carlisle from Edinburgh, and it purchased the Dalkeith line in 1845 to secure part of the route. The new owners altered the gauge to the standard 4 ft 8 1⁄2 in and laid stronger track for locomotive operation. Part of its main line became incorporated into the Waverley Route. Only a small section of the network remains open.
From 1800 the city of Edinburgh had an increasing appetite for coal; although there were coal pits a few miles away, the roads of the time were inadequate, and the horse-and-cart journey added substantially to the cost to the user. Coal owners with pits in the Dalkeith area got together and formed a railway to carry their coal to the capital.
It was designed for horse-drawn operation, with an Edinburgh terminal, called St Leonard's, on the south side of Salisbury Crags. The location was chosen for simplicity of land acquisition, and the coal would in any case need to be distributed in the city; however reaching the location involved a tunnel on a steep gradient, and wagons were hauled up and let down by rope operation controlled by a steam engine.
The line was opened in 1831 from St Leonards to Dalhousie Mains, with a branch line to Fisherrow, a small harbour just to the west of Musselburgh.
A businessman started operating passenger coaches, also horse drawn, from 1832, and this was very successful; the railway company itself later took over the passenger operation.