The most typical expression of cystic fibrosis (CF)-related liver disease is a cholangiopathy that can progress to cirrhosis. We aimed to determine the potential impact of environmental and genetic factors on the development of CF-related cholangiopathy in mice. Cystic fibrosis transmembrane conductance regulator (Cftr)(-/-) mice and Cftr (+/+) littermates in a congenic C57BL/6J background were fed a high medium-chain triglyceride (MCT) diet. Liver histopathology, fecal microbiota, intestinal inflammation and barrier function, bile acid homeostasis, and liver transcriptome were analyzed in 3-month-old males. Subsequently, MCT diet was changed for chow with polyethylene glycol (PEG) and the genetic background for a mixed C57BL/6J;129/Ola background (resulting from three backcrosses), to test their effect on phenotype. C57BL/6J Cftr (-/-) mice on an MCT diet developed cholangiopathy features that were associated with dysbiosis, primarily Escherichia coli enrichment, and low-grade intestinal inflammation. Compared with Cftr (+/+) littermates, they displayed increased intestinal permeability and a lack of secondary bile acids together with a low expression of ileal bile acid transporters. Dietary-induced (chow with PEG) changes in gut microbiota composition largely prevented the development of cholangiopathy in Cftr (-/-) mice. Regardless of Cftr status, mice in a mixed C57BL/6J;129/Ola background developed fatty liver under an MCT diet. The Cftr (-/-) mice in the mixed background showed no cholangiopathy, which was not explained by a difference in gut microbiota or intestinal permeability, compared with congenic mice. Transcriptomic analysis of the liver revealed differential expression, notably of immune-related genes, in mice of the congenic versus mixed background. In conclusion, our findings suggest that CFTR deficiency causes abnormal intestinal permeability, which, combined with diet-induced dysbiosis and immune-related genetic susceptibility, promotes CF-related cholangiopathy.