Gastric cancer, one of the most familiar adenocarcinomas of the gastrointestinal tract, ranks third in the world in cancer-related deaths. Traditional Chinese medicine can suppress the growth of tumors, and the underlying mechanism may be associated with the tumor microenvironment. Here, we investigated the anti-cancer effects of the Qingrexiaoji recipe on gastric cancer and the underlying molecular mechanism. An in vivo nude mouse model was established, and the expression of CD206, CD80, and M2 phenotype-related proteins (Arg-1, Fizz1) was obtained by flow cytometry and western blotting. The expressions of the M2 phenotype-related cytokines were examined by ELISA. Qingrexiaoji recipe inhibited gastric tumor growth and downregulated the expression of CD206, IFN-γ, IL-13, IL-4, and TNF-α in vivo. Qingrexiaoji recipe deceased M2 phenotypic polarization by upregulating microRNA (miR)-29a-3p level. Luciferase activity assays showed that HDAC4 is a potential target of miR-29a-3p. In cells co-transfected with HDAC4 siRNA and miR-29a-3p inhibitor and treated with IL-4 and Qingrexiaoji recipe, the miR-29a-3p inhibitorinduced increase of M2 phenotypic polarization was reversed. In summary, these results suggested that the Qingrexiaoji recipe regulated M2 macrophage polarization by regulating miR-29a-3p/HDAC4, providing a different and innovative treatment for gastric cancer.