Background. Type 2 diabetes mellitus (T2DM) is a kind of disorder of glucose and lipid metabolism with the main clinical manifestation of long‐term higher blood glucose level than the normal value. Farnesol X receptor (FXR)/ceramide signaling pathway plays an important role in regulating cholesterol metabolism, lipid homeostasis, and the absorption of fat and vitamins in diet. Gegen Qinlian Decoction (GQD) is a classical herbal formula, which has a good clinical therapeutic effect on diabetes-related metabolic syndrome. Objective. To investigate the effect of Gegen Qinlian Decoction (GQD) on hepatic gluconeogenesis in obese T2DM rats based on the FXR/ceramide signaling pathway regulating mitochondrial metabolism and endoplasmic reticulum stress (ERS). Methods. ZDF (fa/fa) rats were fed with high-fat diet to establish the T2DM model; GQD was given to T2DM model rats by gavage; changes of the general state and body weight of rats were recorded; fasting blood glucose was detected; blood insulin, blood ceramide, glycosylated hemoglobin in blood, acetyl CoA in liver mitochondria, and bile salt lyase in intestinal tissue were detected by ELISA. The content of T-β-MCA in blood was detected by LC-MS; the content of glycogen in liver tissue was detected by PAS staining; the expression of FXR, Sptlc2, and Smpd3 in ileum tissue, P-PERK, ATF6α, GRP78 BIP, and P-IRE1 in the liver, and CS and PC protein in liver mitochondria was detected by immunohistochemistry and western blot assay. The mRNA expression levels of FXR, Sptlc2, and Smpd3 in the ileum, PERK, ATF6α, GRP78 BIP, and IRE1 in the liver, and CS and PC in liver mitochondria were detected by qRT-PCR. Results. GQD can improve the general state of T2DM rats, slow down their weight gain, reduce the levels of fasting blood glucose, fasting insulin, glycosylated hemoglobin, blood ceramide, bile salt hydrolase in intestinal tissue, and acetyl CoA in liver mitochondria of T2DM rats, and increase the contents of liver glycogen and T-β-MCA in blood of T2DM rats. At the molecular level, GQD can inhibit the expression levels of FXR, Sptlc2, and Smpd3 in the ileum of T2DM rats and the protein and mRNA expression levels of oxidative stress-related factors in the liver. At the same time, GQD can increase the expression of CS and reduce the expression of PC in liver mitochondria of T2DM rats. Conclusion. GQD can inhibit the FXR/ceramide signaling pathway, regulate endoplasmic reticulum stress, enhance the CS activity of liver mitochondria, reduce the acetyl CoA level and PC activity of liver mitochondria, inhibit hepatic gluconeogenesis, protect islet β-cells, and control blood glucose.