In the present study, the effects of different stocking densities on growth performance, hemolymph biochemical and immune indices, as well as on the metabolic and antioxidant enzyme activities in the hepatopancreas of Pacific white shrimp (Penaeus vannamei) were investigated in a biofloc aquaculture system. For the experiment, juvenile shrimp with an initial weight of 3.85 ± 0.34 g were cultured for 35 days in 150 L fiberglass tanks under limited water exchange. Four treatments featuring different stocking densities (0.308, 0.616, 0.924, and 1.23 g/L) were implemented and designated as SD1, SD2, SD3, and SD4, respectively. Results indicated that as the stocking density increased, the final weight, shrimp survival rate, and feed efficiency decreased. Notably, in the SD4 treatment, the shrimp recorded the lowest values: a final weight of 7.01 g, a survival rate of 88.19%, and a feed efficiency of 44.59% (P < 0.05). Regarding hemolymph biochemical indices, higher stocking densities were associated with increased glucose levels. Additionally, SD4 treatment showed the lowest lysozyme activity at 18.33 U/mL/min and the lowest phenoloxidase activity at 0.55 U/mL (P < 0.05). With increasing stocking density, the ALP enzyme activity in the shrimp hepatopancreas decreased, with the lowest value of 46 U/mg protein observed in the SD4 treatment (P < 0.05). No significant differences were observed in AST activity among treatments; however, its levels ranged from 2.85 U/mg protein in SD1 down to 2.93 U/mg protein in SD4 (P > 0.05). Similarly, the activities of antioxidant enzymes (CAT, GPX, and SOD) in the hepatopancreas declined as shrimp stocking density increased in the biofloc system. In the SD4 treatment, the lowest activities recorded for CAT, GPX, and SOD were 0.4, 3.35, and 3.52 U/mg protein, respectively. Under our experimental conditions, it is recommended that the stocking density for shrimp juveniles in the biofloc system be maintained at up to 0.616 g/L, as this level promotes greater weight gain, improved survival rate, enhanced immune, and antioxidant activities.