The invention provides an ecological soil stabilizer and a preparation method thereof. The soil stabilizer comprises the following raw materials in parts by weight: 0.01-0.06 parts of dioctyl sulfosuccinate sodium salt, 0.7-3 parts of lignin fiber, 30-30 parts of salt 60 parts, 20-50 parts of hydroxypropyl methylcellulose, 3-18 parts of hydroxide, 1-13 parts of polyvinyl alcohol, 0.075-0.3 parts of 2-ethylhexanol, 0.5-1.2 parts of isopropanol, 500-900 parts of water, the soil curing agent of the present invention makes the solidified soil easy to compact and stabilize, thereby forming a monolithic structure, making the prepared brick compact density high; and the soil curing agent prepared by the present invention only needs simple mixing and stirring, The process steps are simple, easy to operate, and the curing agent with high solid-to-waste ratio can be obtained by controlling the stirring rate and time, which is used to prepare building bricks with strong compressive strength, low water absorption rate, low mass loss rate, and remarkable curing effect.