Fructusgardeniae(FG) is a traditional Chinese medicine and health food for thousands of years of application throughout Chinese history and is still widely used in clinical Chinese medicine. FG has a beneficial impact on anxiety, depression, insomnia, and psychiatric disorders; however, its mechanism of action requires further investigation. This study aimed to investigate the effects and mechanisms of FG on sleep deprivation (SD)-induced anxiety-like behavior in rats. A model of SD-induced anxiety-like behavior in rats was established by intraperitoneal injection of p-chlorophenylalanine (PCPA). This was accompanied by neuroinflammation and metabolic abnormalities in the hippocampus and disturbance of intestinal microbiota. However reduced SD-induced anxiety-like behavior and decreased levels of pro-inflammatory cytokines including TNF-α and IL-1β were observed in the hippocampus of rats after 7 days of FG intervention. In addition, metabolomic analysis demonstrated that FG was able to modulate levels of phosphatidylserine 18, Phosphatidylinositol 18, sn-glycero-3-phosphocholine, deoxyguanylic acid, xylose, betaine and other metabolites in the hippocampus. The main metabolic pathways of hippocampal metabolites after FG intervention involve carbon metabolism, glycolysis/gluconeogenesis, pentose phosphate, and glycerophospholipid metabolism. 16S rRNA sequencing illustrated that FG ameliorated the dysbiosis of gut microbiota in anxious rats, mainly increased the abundance of Muribaculaceae and Lactobacillus, and decreased the abundance of Lachnospiraceae_NK4A136_group. In addition, the correlation analysis demonstrated that there was a close relationship between hippocampal metabolites and intestinal microbiota. In conclusion, FG improved the anxiety behavior and inhibited of neuroinflammation in sleep-deprived rats, and the mechanism may be related to the FG regulation of hippocampal metabolites and intestinal microflora composition.