The invention discloses an automatic fire extinguishing system for a server. A PCB is provided with a smoke sensor, a fan module comprises a plurality of groups of fans, a plurality of storage tanks are formed in a closed space defined by a shell, an enclosure and an inner ring, and a fire extinguishing material is arranged in the storage tanks; a blowing opening is formed in one side of a rotating disc, a blowing pipe is arranged outside the rotating shaft in a sleeving mode, a plurality of communicating pipes are connected to the blowing pipe in a penetrating mode, and the other ends of thecommunicating pipes are communicated with the storage tanks. According to the automatic fire extinguishing system, the smoke sensor is arranged at an air outlet of the case, the fire extinguishing material is in the storage tanks, when the smoke sensor detects that smoke in the system is generated, the signal is transmitted to the BMC, the BMC controls the electromagnetic valve on the communicating pipe to be opened after receiving the smoke sensor signal, the fire extinguishing material is dispersed inside the system under the action of the air flow through the blowing opening, the fire extinguishing requirement is met, further spreading of fire is avoided, and further loss of personnel and property is avoided.