The invention relates to the technical field of electric cabinet fire extinguishing, in particular to an electric cabinet with an automatic fire extinguishing function. The electric cabinet comprisesa storage cavity, a stirring shaft, a sleeve rod, a connecting spring, a stirring block, a third connecting shaft, a coupler, a driving wheel, a driving groove, a grinding roller, a driving rod, a push plate, a feeding barrel, an air storage tank, a fourth connecting shaft, a connecting base, a cover plate, a piston plate, a piston rod and a telescopic pipe; the push plate is an air bag plate; a smoke discharging barrel, an exhaust pipe, a mounting groove, an air suction fan, a sixth connecting shaft, a first filter plate, a second filter plate, a clamping block and a clamping groove are alsoarranged, so that when the grinding roller rolls caked dry powder, the dry powder can be pushed into the feeding barrel, and smoke generated by combustion can be discharged out of a cabinet body, so that the problem that black smoke (small particles) generated by plastic combustion causes faults of circuit elements is avoided.