This study investigates the impact of different diets on fish growth and bacterial community structure present in the intestine of goldfish (Carassius auratus) and their aquaculture water under recirculating water conditions. We assumed that different types of diet would form different intestinal microbiota that may affect host growth. Using Illumina MiSeq high-throughput sequencing, we analyzed bacterial communities in goldfish fed with formulated pellet feed, Tubifex worms (Limnodrilus hoffmeisteri), and an alternating diet of both. Over a 14-day feeding trial, no significant differences in juvenile goldfish growth were observed between groups. After 7 days, diet changes significantly influenced the abundance and diversity of intestinal bacteria, with the alternating diet notably enhancing bacterial diversity in both the intestines and water. However, these differences in bacterial diversity decreased by day 14. The results indicate that diet type affects microbial community diversity in the intestines and water of goldfish, and that goldfish intestines maintain a stable core bacterial community structure. This highlights the potential for optimizing diet types to enhance microbial health and stability in aquaculture systems and, in addition, provides an important scientific basis for alternative diets in goldfish aquaculture in the industry.