A system for automatically cleaning and washing an ice cream machines includes a liquid container for storing raw materials a freezing cylinder connected with the liquid container through a cleaning pathway a water tank for storing rinse water to rinse the freezing cylinder and the cleaning pathway a detergent tank for storing detergents to clean and wash the freezing cylinder and the cleaning pathway a pump arranged on the cleaning pathway to selectively pump the raw material, the rinse water or the detergent and a control panel adapted to control an on/off and cleaning.