The invention discloses a preparation method of a cement foaming agent, which belongs to the field of materials. A method for preparing a cement foaming agent, comprising the following steps: 1) preparing raw materials according to the following parts by weight: 20-30 parts of fatty alcohol polyoxyethylene ether sodium sulfate, 5-10 parts of starch, 10-20 parts of saponin, 20-30 parts of gelatin, 10-15 parts of sodium bicarbonate, 10-15 parts of n-hexane, 15-20 parts of trichlorofluoromethane. 2) Dissolve sodium bicarbonate in water and stir well; 3) Add sodium fatty alcohol polyoxyethylene ether sulfate, saponin, n-hexane, and trichlorofluoromethane into water in sequence, and stir well; 4) Add gelatin to water, Fully stir evenly to get the product. The cement foaming agent of the present invention has easy-to-obtain raw materials, wide sources, low cost, particularly strong foaming ability, large foam production per unit volume, very stable foam, no defoaming for a long time, fine foam, high foaming multiple, Good foam stability and other advantages.