The Alulu beer receipt records a purchase of "best" beer from an ancient Sumerian
brewery, c. 2050 BC
Beer may have been known in Neolithic Europe  and was mainly brewed on a domestic scale.
In some form, it can be traced back almost 5000 years to Mesopotamian writings describing daily rations of beer and bread to workers. Before the rise of production breweries, the production of beer took place at home and was the domain of women, as baking and brewing were seen as "women's work".
19th century brewery installations
The machine room of the former brewery Wielemans-Ceuppens in Brussels
Breweries, as production facilities reserved for making beer, did not emerge until monasteries and other Christian institutions started producing beer not only for their own consumption but also to use as payment. This industrialization of brewing shifted the responsibility of making beer to men.
The oldest, still functional, brewery in the world is believed to be the German state-owned Weihenstephan brewery in the city of Freising, Bavaria. It can trace its history back to 1040 AD. The nearby Weltenburg Abbey brewery, can trace back its beer-brewing tradition to at least 1050 AD.:30 The Žatec brewery in the Czech Republic claims it can prove that it paid a beer tax in 1004 AD.
Early breweries were almost always built on multiple stories, with equipment on higher floors used earlier in the production process, so that gravity could assist with the transfer of product from one stage to the next. This layout often is preserved in breweries today, but mechanical pumps allow more flexibility in brewery design. Early breweries typically used large copper vats in the brewhouse, and fermentation and packaging took place in lined wooden containers. Such breweries were common until the Industrial Revolution, when better materials became available, and scientific advances led to a better understanding of the brewing process. Today, almost all brewery equipment is made of stainless steel.
During the Industrial Revolution, the production of beer moved from artisanal manufacture to industrial manufacture, and domestic manufacture ceased to be significant by the end of the 19th century.
Major technological advances
A handful of major breakthroughs have led to the modern brewery and its ability to produce the same beer consistently. The steam engine, vastly improved in 1775 by James Watt, brought automatic stirring mechanisms and pumps into the brewery. It gave brewers the ability to mix liquids more reliably while heating, particularly the mash, to prevent scorching, and a quick way to transfer liquid from one container to another. Almost all breweries now use electric-powered stirring mechanisms and pumps. The steam engine also allowed the brewer to make greater quantities of beer, as human power was no longer a limiting factor in moving and stirring.
Carl von Linde, along with others, is credited with developing the refrigeration machine in 1871. Refrigeration allowed beer to be produced year-round, and always at the same temperature. Yeast is very sensitive to temperature, and, if a beer were produced during summer, the yeast would impart unpleasant flavours onto the beer. Most brewers would produce enough beer during winter to last through the summer, and store it in underground cellars, or even caves, to protect it from summer's heat.
The discovery of microbes by Louis Pasteur was instrumental in the control of fermentation. The idea that yeast was a microorganism that worked on wort to produce beer led to the isolation of a single yeast cell by Emil Christian Hansen. Pure yeast cultures allow brewers to pick out yeasts for their fermentation characteristics, including flavor profiles and fermentation ability. Some breweries in Belgium, however, still rely on "spontaneous" fermentation for their beers (see lambic).
The development of hydrometers and thermometers changed brewing by allowing the brewer more control of the process, and greater knowledge of the results.