The gut microbiota plays an essential role in maintaining the health and fitness of the host organism. As a critical environmental variable, temperature exerts significant effects on animal survival and reproduction. Elevated temperatures can influence the composition and function of the animal gut microbiota, which may have potentially detrimental effects on the host. The crocodile lizard (Shinisaurus crocodilurus) is an ancient and currently endangered reptile species due to human hunting and habitat destruction. Given the predicted shifts in global temperatures in the next century, it is important to understand how warming affects the gut microbiota of these vulnerable lizards, which remains unclear. To determine how the microbial communities change in crocodile lizards in response to warming, we analyzed the gut microbiota under five temperature conditions (22°C, 24°C, 26°C, 28°C, and 30°C) using 16S rRNA high-throughput sequencing. Results showed that the dominant phyla, Proteobacteria and Bacteroidetes, in gut microbiota were not significantly affected by temperature variations, but increasing temperature altered the structure and increased the community richness of the gut microbiota. In addition, warming changed the abundance of Pseudomonas aeruginosa and Actinobacteria, which may have negative effects on the physiological health of the crocodile lizards. Functional prediction analysis demonstrated that the functional pathways enriched in crocodile lizards were mainly related to metabolism, with no significant differences observed in these pathways at KEGG pathway level 1 after warming. These results provide valuable insights into the ecological adaptations and regulatory mechanisms employed by crocodile lizards in response to warming, which may be of benefit for their conservation.