Bile acid metabolism, involved with the digestion and absorption of nutrients in the gut, is linked to the gut microbiota community, greatly impacting the host’s metabolism. We examined the hypothesis that the modulation of bile acid metabolism by dietary fat contents, gallbladder removal (GBX; cholecystectomy), and bile acid sequestrant (BAS; cholestyramine) treatment could alter energy, glucose, and lipid metabolism through the changes in the gut microbiota. Mice were randomly assigned to the following six groups: (1) Sham GBX surgery (Sham) + low fat/high carbohydrate diet (LFD), (2) Sham + high fat diet (HFD), (3) Sham + HFD + BAS, (4) GBX + LFD, (5) GBX + HFD, and (6) GBX + HFD + BAS. BAS groups received 2% cholestyramine. After an 8-week intervention, energy, glucose, and lipid metabolism, and the gut microbiota community were measured. HFD groups exhibited higher body weight gain than LFD, and GBX increased the weight gain comped to Sham groups regardless of BAS in HFD (p < 0.05). Homeostatic model assessment for insulin resistance (HOMA-IR) was higher in HFD than LFD, and GBX increased it regardless of BAS. Serum lipid profiles were worsened in GBX + HFD compared to Sham + LFD, whereas BAS alleviated them, except for serum HDL cholesterol. Hepatic tumor-necrosis-factor-α (TNF-α) mRNA expression and lipid peroxide contents increased with GBX and BAS treatment compared to Sham and no BAS treatment (p < 0.05). Hepatic mRNA expression of sterol regulatory element-binding transcription factor 1c (SREBP1c) and peroxisome proliferator-activated receptor gamma (PPAR-γ) exhibited the same trend as that of tumor necrosis factor-α (TNF-α). The α-diversity of gut bacteria decreased in GBX + HFD and increased in GBX + HFD + BAS. Akkermentia, Dehalobacterium, SMB53, and Megamonas were high in the Sham + LFD, and Veillonella and Streptococcus were rich in the Sham + HFD, while Oscillospira and Olsenella were high in Sham + HFD + BAS (p < 0.05). GBX + LFD increased Lactobacillus and Sutterella while GBX + HFD + BAS elevated Clostridium, Alistipes, Blautia, Eubacterium, and Coprobacillus (p < 0.05). In conclusion, the modulation of bile acid metabolism influences energy, glucose, and lipid metabolisms, and it might be linked to changes in the gut microbiota by bile acid metabolism modulation.