A device for sterilizing an ice machine using ozone gas from an electrolytic ozone generator includes a pure water tank (2), a pure water refilling device (1), and the electrolytic ozone generator (3). The pure water tank (2) is connected to a gas-feeding solenoid valve (4) and a gas-discharging solenoid valve (5). The gas-discharging solenoid valve (5) is connected to a reducing carbon tank (6), which is connected to a vent (10). The gas-feeding solenoid valve (4) is connected to a tee pipe (11-4) of the ice machine (11). The tee pipe (11-4) is connected to a water pump (11-2) in an ice-machine water tank (11-1) and an ice-machine evaporator (11-3) through loop piping. A controlling circuit board (7) is connected to power source (8), and further connected to the electrolytic ozone generator (3), the gas-feeding solenoid valve (4), the gas-discharging solenoid valve (5), and a motherboard (11-6).