The station was opened along with the first section of the Caledonian Railway's main line from in September 1847. The line initially terminated at, but was completed through to Glasgow & Edinburgh early the following year. A branch line from here to via Lochmaben was completed in September 1863 – this was constructed by the independent Dumfries, Lochmaben & Lockerbie Railway, but was absorbed by the Caledonian company two years later. Though this route allowed the Caledonian company to reach Dumfries and thus compete with the rival Glasgow and South Western Railway, it never developed beyond country branch status. On 4 May 1883, an accident occurred when the branch service from Stranraer via the Dumfries, Lochmaben and Lockerbie Railway passed a signal and entered the station at 23:25. It collided at low speed, with a goods train already on the northbound line. This collision, though minor, forced carriages from the goods train onto the southbound line and into the path of the speeding Glasgow Express which smashed into the wreckage and derailed onto the station platform. Seven people were killed, including the driver and fireman of the express. The guard from the express ran down the line to warn another approaching train of the accident and prevented a further collision. There were 300 injuries. The driver of the first train, the Lockerbie station master and the local inspection regime were all criticised for their actions in the subsequent report on the crash. The branch to Dumfries was closed to passenger services by the British Transport Commission in May 1952. Goods traffic continued until 1966, when the line fell victim to the Beeching Axe. Except Lockerbie all other local stations on the main line between Carlisle and Carstairs closed during the 1960s. The first electrically-operated passenger services operated byBritish Rail in May 1974 when the West Coast Main Line electrification project between Crewe & Glasgow was completed. Services northwards to Glasgow and Edinburgh were suspended in January 2016 and replaced by buses, whilst major repairs were carried out the River Clyde viaduct at Lamington that was damaged by Storm Frank. Trains resumed on 22 February 2016.
Services and current operations
Lockerbie station is managed by Abellio ScotRail although the company does not provide any services to or from the station. Lockerbie is the only railway station in Scotland that is not served by Abellio ScotRail. All services are provided by Avanti West Coast and TransPennine Express.
TransPennine Express
provide most services, 7 days a week, There is an hourly service to Manchester Airport and a 2-hourly service to both Glasgow Central and Edinburgh Waverley though there are a few services which do not call here leaving some gaps in the timetable.
Avanti West Coast
operate six daily services. There are three trains per day to Glasgow Central, one to Birmingham New Street, one to London Euston and one to Crewe. On Sundays, there are two trains per day to Glasgow, one to London and one to Crewe.