Background: Hepatolithiasis (HL) is one of the common diseases in hepatobiliary surgery, and bile duct fibrosis is the key step in the pathogenesis of HL. Salvia miltiorrhiza (S. miltiorrhiza) has an inhibitory effect on bile duct fibrosis, but its molecular mechanism remains unclear. Objectives: Our research aimed to clarify the molecular mechanism of S. miltiorrhiza on HL. Materials and Methods: The rats were fed with salvianolic acid B and salvianolic acid B-free lithogenic diet (LD) for 4 weeks to observe the degree of bile duct fibrosis. The expression levels of TNF, IL1B, IL6, and MRP2 in HIBEC stimulated by taurodeoxycholic acid (TDCA) were measured by RT-qPCR and ELISA. E-cadherin and Vimentin expression in HIBEC was detected using immunofluorescence and Western blot. Cell proliferation was detected by CCK8. Results: The fibrosis of the bile duct was the key step of HL. The NF-κB pathway was activated and MRP2 was expressed low in intrahepatic biliary epithelial cells surrounding bile duct stones. Through experiments, salvianolic acid B (Sal B) delays HL via the NF-κB/MRP2 axis. Conclusion: In this research, we confirmed that salvianolic acid B inhibited the HL via the NF-κB/MRP2 axis.