A coffee machine for producing and dispensing coffee-based beverages is disclosed, including a hydraulic pump and at least one dispensing device comprising a filter unit apt to contain ground coffee. A hydraulic circuit brings the hydraulic pump into fluid communication with a supply unit of the dispensing device. The hydraulic circuit includes a supply duct which supplies hot water under pressure to the supply unit. A system for controlling the dispensing pressure includes a control unit, a pressure sensor, and a hydraulic variable-flow valve. The variable-flow valve is actuated by an electronic drive controlled electronically by the control unit in order to regulate the flow rate of water output as a function of a detected dispensing pressure value.