This study aimed to investigate the effects of ginger straw as a replacement of peanut straw on the growth, meat quality, rumen fermentation, and immunity of goats. In this study, 40 Huanghuai male goats, weighing 30 +/- 0.5 kg at six months of age, were selected and randomly divided into four treatments: ginger straw 0% (G0), 5% (G5), 10% (G10) and 20% (G20) replacing peanut straw, with 10 goats in each treatment. Goat dry matter intake (DMI) improved as the proportion of peanut straws replaced with ginger straws increased (linear, P < 0.001, quadratic, P < 0.001). The highest average daily gain (ADG) and the lowest feed-to-gain ratio (F/G) were observed in G5 goats (P < 0.001). The digestibilities of neutral detergent fibre (NDF, P = 0.031) and acid detergent fibre (ADF, P = 0.014) were higher in the G5 group than in G10 and G20. With increasing ginger straw replacement, the plasma interleukin-10 (IL-10) levels increased (linear, P = 0.035, quadratic, P = 0.041). The microbial protein (MCP) increased as the proportion of ginger straw increased (linear, P = 0.034, quadratic, P = 0.041). The butyrate was increased (linear, P = 0.028, quadratic, P = 0.035) at all levels of ginger straw inclusion into the diet. A linear (P < 0.001) increase in the height of the jejunal mucosal villi was observed as the proportion of ginger straw in the diet increased. The tight junction protein 1 (TJP1) and claudin-1 mRNA expression in the jejunal mucosa were significantly higher in groups G5, G10, and G20 than in the G0 group (P < 0.001). In general, substituting peanut straw with ginger straw in goat diets promoted rumen fermentation and produced more volatile fatty acids and microbial proteins to meet the needs of goats for improved growth performance. Substituting ginger straw for peanut straw improved immunity and the intestinal barrier in goats and did not adversely affect meat quality. Replacing peanut straw with 5% ginger straw in the goat diet resulted in higher NDF digestibility and growth performance. Therefore, the replacement of peanut straw with 5% ginger straw in goat diets is recommended. (c) 2025 The Authors. Publishing services by Elsevier B.V. on behalf of KeAi Communications Co. Ltd. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/bync-nd/4.0/).