The cab, crew compartment or driver's compartment of a locomotive, or a self-propelled rail vehicle, is the part housing the train driver, fireman or secondman (if any), and the controls necessary for the locomotive or self-propelled rail vehicle's operation.
On steam locomotives, the cab is normally located to the rear of the firebox, although steam locomotives have sometimes been constructed in a cab forward or camelback configuration.
The cab, or crew or driver's compartment of a diesel or electric locomotive will usually be found either inside a cabin attached to a hood unit or cowl unit locomotive, or forming one of the structural elements of a cab unit locomotive.
The former arrangement is now the norm in North America for all types of diesel or electric locomotives. In Europe, most modern locomotives are cab units with two cabs, one at each end. However, the locomotives powering some high speed European trains are normally cab units with one cab, and European shunting locomotives are usually hood units.
On self-propelled rail vehicles, the cab may be at one or both ends.
The earliest locomotives, such as Stephenson's Rocket, had no cab; the locomotive controls and a footplate for the crew were simply left open to the elements. However, to protect locomotive crews against adverse weather conditions, locomotives gradually came to be equipped with a roof and protective walls, and the expression "cab" refers to the cabin created by such an arrangement.
By about 1850, high speed Crampton locomotives operating in Europe already had a much needed windshield giving some protection to the footplate area. Some other early locomotives were even fitted with a cab as part of a rebuilding program, an example being the locomotive John Bull.
In Germany, the locomotive cab was introduced by the Saxon railway director and writer Max Maria von Weber. However, until 1950 the railway directorates of the German-speaking countries continued to believe that a standing posture was essential to maximise crew vigilance. Steam locomotive drivers, who had to lean out of their cabs for better visibility, therefore frequently developed occupational diseases, along with rheumatism, and electric locomotive drivers suffered from wear to the knees.
This unsatisfactory situation changed—with few exceptions—only with the construction of the German standard electric locomotives, which for the first time were equipped with crew seats. Meanwhile, the maintenance of crew vigilance became possible by technical means through the use of Sifa devices.