Anaerobic membrane bioreactor (AnMBR) shows great potential for textile wastewater treatment, but high salinity in the influent may undermine its performance. This study evaluated the impact of salinity on the treatment performance of an upflow anaerobic sludge blanket (UASB) configured AnMBR using a flat sheet ceramic membrane. The salinity was stepwise increased (0, 5, 10 and 20 g/L) in four phases of the AnMBR operation. Results indicated that increased salinity jeopardized the COD removal efficiency of AnMBR from 92% to 73%, but had a marginal effect on dye removal efficacy (90–96%). Low salinity (5 g/L) boosted the biogas production whilst high salinity (>10 g/L) had a negative impact. Additionally, the increase of salinity resulted in the soluble microbial production (SMP) concentration soar and membrane fouling rate increase, peaking at a salinity of 10 g/L (Phase III) and recovering back to a lower level at a salinity of 20 g/L (Phase IV). This indicated a transition occurrence at a salinity of 10 g/L (Phase III). The microbial diversity analyses further suggested a transition from salinity-sensitive microbes (Aminiphilus, Caldatribacterium, Mesotoga, Methanobrevibacter, Methanobacterium, Methanosaeta) to salinity-tolerant microbes (Longilinea, Ignavibacterium, Rhodovarius, Bosea and Flexilinea). This transition can be associated with the increase SMP concentration and more severe membrane fouling in Phase III, which were mitigated after a new equilibrium was reached when the microbial consortium acclimatized to the high salinity. Finally, a machine learning model of the Adaboost algorithm was established to predict COD removal under different salinities. Importantly, this study revealed that AnMBR process performance and membrane operation can be maintained for high salinity textile wastewater treatment with a halophilic microbial community growth under high-salinity selection pressure.