The invention discloses a traditional Chinese medicine for treating peptic ulcer and a preparation method thereof. The traditional Chinese medicine is prepared from the following medicinal materials in parts by weight: 24-39 parts of astragalus root, 21-28 parts of Zhejiang fritillary bulb, 19-31 parts of dried ginger, 11-20 parts of amomum fruit, 13-24 parts of tetradium ruticarpum, 20-38 parts of magnolia bark, 18-27 parts of glycyrrhiza uralensis, 16-29 parts of wolfberry, 11-23 parts of bupleurum root, 15-28 parts of radix paeoniae alba, 1-7 parts of costus root, 9-18 parts of cortex dictamni, 2-9 parts of salvia miltiorrhiza, 11-18 parts of poria cocos, 2-8 parts of angelica sinensis, 3-8 parts of chorion ovi, 3-7 parts of radix curcumae, 5-13 parts of natural indigo, 6-19 parts of borneol, 5-13 parts of pomegranate bark, 9-18 parts of prepared ovate atractylodes, 2-8 parts of rhubarb root, 3-7 parts of coptis root, 1-6 parts of panax pseudo-ginseng, 2-7 parts of pinellia tuber, 3-8 parts of dried tangerine peel and 1-7 parts of citrus aurantium. The traditional Chinese medicine is a pure Chinese traditional medicine prescription, and is low in toxic or side effects, good in treatment effect, short in treatment course and high in cure rate during the treatment of peptic ulcer; the source of the medicinal materials is wide, and the cost is low, so that the traditional Chinese medicine is applicable to clinical popularization and application.