The gut microbiome is affected by host intrinsic factors, diet, environment, and strongly linked to host's health. Although fluctuations of microbiome composition are normal, some are due to changes in host environmental conditions. When species are moved into captive environments for conservation, education, or rehabilitation, these new conditions can influence a change in gut microbiome composition. Here, we compared the microbiomes of wild and captive Comal Springs riffle beetles (Heterelmis comalensis) by using amplicon sequencing of the 16S rRNA gene. We found that the microbiome of captive beetles was more diverse than wild beetle microbiomes. We identified 24 Amplicon Sequence Variants (ASVs) with relative abundances significantly different between the wild and captive beetles. Many of the ASVs overrepresented in captive beetle microbiomes belong to taxa linked to nitrogen-rich environments. This is one of the first studies comparing the effects of captivity on the microbiome of an endangered insect species. Our findings provide valuable information for future applications in the management of captive populations of H. comalensis.