Non-alcoholic fatty liver disease (NAFLD) is currently related to a heavy socioeconomic burden and increased incidence. Since obesity is the most prevalent risk factor for NAFLD, weight loss is an effective therapeutic solution. Bariatric surgery (BS), which can achieve long-term weight loss, improves the overall health of patients with NAFLD. The two most common surgeries are the Roux-en-Y gastric bypass and sleeve gastrectomy. The gut-liver axis is the complex network of cross-talking between the gut, its microbiome, and the liver. The gut microbiome, involved in the homeostasis of the gut-liver axis, is believed to play a significant role in the pathogenesis of NAFLD and the metabolic improvement after BS. Alterations in the gut microbiome in NAFLD have been confirmed compared to that in healthy individuals. The mechanisms linking the gut microbiome to NAFLD have been proposed, including increased intestinal permeability, higher energy intake, and other pathophysiological alterations. Interestingly, several correlation studies suggested that the gut microbial signatures after BS become more similar to those of lean, healthy controls than that of patients with NAFLD. The resolution of NAFLD after BS is related to changes in the gut microbiome and its metabolites. However, confirming a causal link remains challenging. This review summarizes characteristics of the gut microbiome in patients with NAFLD before and after BS and accumulates existing evidence about the underlying mechanisms of the gut microbiome.