The Derby Works comprised a number of British manufacturing facilities designing and building locomotives and rolling stock in Derby, England. The first of these was a group of three maintenance sheds opened around 1840 behind Derby station. This developed into a manufacturing facility called the Midland Railway Locomotive Works, known locally as "the loco" and in 1873 manufacturing was split into locomotive and rolling stock manufacture, with rolling stock work transferred to a new facility, Derby Carriage & Wagon Works.

From its earliest days, it had carried out research and development in a number of areas, and in 1933 the London, Midland and Scottish Railway opened the LMS Scientific Research Laboratory. Around 1964, this became part of a new British Rail Research Division, based in the purpose-built Railway Technical Centre, which also housed the Department of Mechanical & Electrical Engineering (DM&EE) and later the headquarters of British Rail Engineering Limited.

Early days Around 1840, the North Midland Railway, the Midland Counties Railway and the Birmingham and Derby Railway set up workshops to the rear of Derby station. Although the Midland Counties had an engine house at Nottingham, the main facilities for all three lines appear to have been, initially at least, those at Derby. That for the Birmingham and Derby was next to its line, near London Road. It was about long and wide, with three lines and three wide archways at its entrance, supporting a water tank. In one corner was a smithy. The Midland Counties' shed was rectangular and about long to the north of the site. Adjacent to it were water and coke facilities, and locomotive repair workshops. The North Midland's became a full repair facility, with a smithy, lathes and other machine tools. These were associated with what is believed to be the first Roundhouse, designed by Francis Thompson. On each side of it, in a vee, were workshops for locomotive and rolling stock repair.

In 1841, problems were becoming apparent with the heat of the exhaust gases through the fireboxes of the locomotives, and the North Midland works assisted George Stephenson in the design of his Long Boiler locomotive In the same year, the Midland Counties locomotive Bee (formerly Ariel) was fitted with Samuel Hills Smoke Consuming Apparatus in an attempt to conform to the Government's insistence that they should consume their own smoke. This experimentation was carried on with the use of a brick arch in the firebox to use the cheaper coal instead of coke, but it was initially unsuccessful.

Midland Railway Matthew Kirtley When the three companies merged in 1844 to form the Midland Railway, Derby became its headquarters and the workshops merged to become the Midland Railway Locomotive Works. The immediate task was to achieve some standardisation in the various locomotives that it had inherited. Locomotives at that time were designed and built by manufacturers who might be lacking in actual operating experience with their products. The first Locomotive and Carriage Superintendent was Matthew Kirtley who persuaded various manufacturers to build to his own design and in 1849 50 six-coupled goods engines were delivered.

After improving the workshops and facilities, including a second roundhouse in 1847, he persuaded the directors that the railway should build its own engines. New building began in 1851 with passenger engines to the Jenny Lind pattern, and more standard goods. He then produced a large "single" with six-foot six-inch driving wheels. Throughout its existence the Midland never became fully self-sufficient, usually having its locos built by private contractors to its own designs. Initially there was some resistance on the part of Sharp Stewart and Stephenson, who quoted over-long delivery times, so that Kirtley had to accept the maker's own designs. These were good enough, however, that Fowler built some more to a similar pattern. In 1861 he built four banking engines for the Lickey Incline with four-foot drivers instead of the usual five feet. Kirtley's first was a rebuilt but he went on to build six for use to King's Cross, then 15 more.

A further, much larger, roundhouse was built in 1852, followed by a large rectangular engine shed with two turntables in 1890. The original North Midland workshop, which by then had become offices, was raised by one storey in 1859–60, the clock tower being increased in height accordingly. A long footbridge was added from the entrance door to the front of the station, of which only a fragment remains today. A third floor was added in 1893.

Another of Kirtley's achievements in 1859 was, at last, to solve the problem of coal burning, by combining the brick arch with a firehole door deflector plate and a blower to increase the draught. Research into track wear was carried out by Robert Forester Mushet, who produced the first double-headed rail using Bessemer steel. Whereas wrought iron rails lasted typically six months, a length of steel rail laid near Derby station 1857 was still in use in 1873.

Kirtley also introduced a system of templates and gauges based on the Whitworth system. Meanwhile, wrought iron axles failures were a problem. In 1870–1871, Kirtley began a programme of research which eventually resulted in the introduction of steel.

By the end of the 1860s the works had expanded to such an extent, that he was considering reorganising it; and, in 1873, it separated into the Locomotive Works, remaining behind the station, and Derby Carriage & Wagon Works, further south, off Litchurch Lane.

Samuel Johnson Kirtley died in office in 1873 leaving a respectable legacy of development and sound locomotives, some of which lasted 80 years. The works reorganisation was completed in 1887 by his successor Samuel Waite Johnson, the carriage and wagon works coming under the control of Thomas Gethyn Clayton. In addition the works took over the old Derby Gas Company works.

Johnson continued to build four-coupled passenger locos for the steeper grades, but also some 2-2-2 singles for lighter work. In 1886, the workshop manager, F. Holt, devised a system of applying sand beneath the wheels to improve adhesion. This system is still in use today, using compressed air instead of steam as the propellant.

In 1897 a general strike was followed by a rapid rise in the economy. The railway had placed orders for 170 new locos with private builders, all of whom were snowed under. By the end of 1898 none had been delivered and the railway was under pressure from its goods customers, particularly in Sheffield. The Midland ordered 20 s from the Burnham & William's Baldwin Locomotive Works in the United States which were supplied as parts for assembly. Since the workshops were also full, they had to be assembled in the open air by quickly-recruited labour. Wishing to order 20 more, which Baldwin could not supply, ten were ordered from the Schenectady Locomotive Works. The Baldwin's American appearance raised a good deal of comment.

The most famous singles, the Midland Spinners, were built in 1900 and the Belpaire firebox appeared on some s. The first of the "Midland Compounds" appeared in 1904. This was based on a North Eastern Railway two-cylinder which had been rebuilt to three cylinders, and became the basis for a number of classes over the following years, totalling 240 engines. He also produced a very simple, but robust, goods engine of which 865 were built from 1875 to 1902.

Richard Deeley Johnson retired in 1903 and was succeeded by Richard Deeley who began as an apprentice at the works. He carried on much where Johnson had left off, but improved the compounds with an uprated boiler and firebox, also changing the tender to a smaller six-wheeled design. Deeley was very soon promoted to Locomotive Superintendent, with Cecil Paget as Works Manager.

In 1904 two steam motor-carriages for the Morecambe-Heysham service were fitted out at the carriage works. Since he was also Locomotive Superintendent, he reorganised the numbering system in 1907 so that different groups of numbers were used for different classes. Among his improvements to the works, he devised a heavy testing rig for structure testing up to 50 tons in what had developed into a dedicated Engineering Testing Department.

By 1900 some 40,000 people were employed, producing 40 new engines a year. Electric power and lighting was installed in the Locomotive Works during 1910, supplied by the company's new generating plant located across the Derby canal at the rear of the Works. An earlier and smaller scale electric generating station had been built by the Midland during March 1893 in Calvert Street, Derby to provide current to light the station offices, the Midland Hotel and the Locomotive Works offices. A textile research facility was opened in Calvert Street for upholstery and seat materials. This facility is thought to have used the buildings made redundant by the closure of the 1893 generating station when the new generating station was brought on line in 1910.

Henry Fowler In 1907 Paget became General Superintendent, with Henry Fowler becoming Works Manager. In 1908 Paget caused to be built a revolutionary new locomotive, the Paget locomotive based on the Willans high speed central valve engines, some of which had been installed at the works.

In 1908 the Heysham to Morecambe line was electrified at 6.6kV 25 Hz and Derby supplied three 60-foot long motor coaches with electrical equipment from Siemens and Westinghouse.

In 1909 Henry Fowler became the Mechanical Engineer. For the next five years, rebuilding continued and then came World War I.

From 1914 the works turned to aiding the war effort, producing eleven howitzers by the end of the year. Like most of the other works, Derby produced large number of shells and their components. Initially producing 3000 fuses a week, it installed automated equipment, increasing production tenfold, the work being mainly undertaken by some 500 women.

Some new locomotives, however, were built for the Midland's own use and some for the Midland & Great Northern Joint Committee and the Somerset & Dorset Joint Railway. Notable among them were the Somerset & Dorset s, a class of heavy freight locomotives for the Dorset banks, extremely large by Midland standards. Eleven were built in two batches in 1914 and 1925. A new more powerful was designed in 1911 and two were built. Quantity production began in 1917 with 192 being built in the first few years, and a further 580 after grouping up to 1940. Another remarkable engine of this period was the 0-10-0 "Lickey Banker", designed in 1919, by James Clayton for use on the Lickey Incline south of Birmingham.

London, Midland and Scottish Railway

George Hughes The co-operation between the railways in the war effort to some extent smoothed the way to amalgamation in 1923 with the Midland becoming part of the London, Midland & Scottish Railway. George Hughes became the Chief Mechanical Engineer. However he preferred to make his headquarters at Horwich, building the famous 2-6-0 "Horwich Crabs". He was succeeded in 1925 by Henry Fowler, by Ernest Lemon in 1931, and finally in 1932 by William Stanier.

The major source of friction, however, was the Midland's policy of using small engines, adding another if the load warranted it, or for hilly stretches. This had worked perfectly well, for the Midland's track in general was level, but trains were becoming heavier. The other major member of the grouping, the London & North Western Railway (LNWR), had already invested in larger engines for its lines north of Manchester. Another passion imported from the Midland was for standardisation, which, in the case of axleboxes was to prove problematic for future heavier locos.