A machine for producing products such as ice cream, frozen beverages or granita comprises a product container (12) which is provided with a tap (15) for dispensing the product. A cylinder (16) with a substantially horizontal axis (17), which forms the evaporator of a refrigerating circuit of the machine for cooling the product in the container, projects from a rear wall (23) into the container. A mixer element (18) is present around the cylinder and rotates coaxially with the axis (17) of die cylinder by means of a motor unit (19) connected to the mixer element (18) by means of a drive shaft (20) which passes along the axis of the cylinder and which is connected to the mixer element (18) at one end of the cylinder which is opposite to the said rear wall (23). The motor unit (19) is at least partially housed inside the cylinder (16) through the said rear wall (23), so as to reduce the overall dimensions of the machine.