Foam, as a gas‐in‐liquid colloid, has a higher appearance viscosity than the one of both gas and liquid that form it. Adjusting the mobility ratio of the injected fluid–oil system and increasing gas diffusion in the foam injection process increase oil production. With these properties, foam as an injection fluid in fractured reservoirs has a major effect on oil production from the matrixes and prevents premature production of injection fluid. Surfactants are common foaming agents in injection water. Saponins are known as plant‐derived surfactants for forming stable foam. This feature, along with its cheap price and availability, can make them candidates for enhanced oil recovery (EOR) by the foam injection method. However, the utilization of CO2 as the gaseous phase in foam introduces additional machanisms of CO2 injection to the oil recovery operations. In this assessment, a non‐ionic green surfactant derived from the Anabasis setifera plant was used as a foaming agent, while CO2 served as the gas phase. A series of surface tension tests in CO2 environment were performed to determine the optimal concentration of the surfactant. Foaming tests were performed by a designed foam generator. The produced CO2‐foam was then injected into a fractured carbonate plug with six matrixes (with one horizontal and two vertical fractures). Based on the results, the water–CO2 surface tension was reduced to 20.549 mN/m. The optimum salinity based on the foam stability was 10,000 ppm. The half‐life of the foam was determined to be 40 min. Also, the foam characterization showed that the foamability of the surfactant was favourable for increasing oil production so that by secondary flooding, an oil recovery of more than 66% was achieved from the fractured carbonate plug.