Increasing evidence suggests that alteration of gut microbiota ('dysbiosis') can lead to a number of diseases, including obesity, which affects a large population in the world and is now a global health issue. The mechanisms of gut microbiota-mediated obesity are just being explored and characterized in recent years. It has been suggested that dysbiosis of gut microbiota contributes to obesity development mainly in three ways: affecting energy harvest, altering host gene expression, and triggering chronic inflammation. Among the factors that determine and influence gut microbiota composition, diet is one of the best characterized in human and animal studies, and has been long linked with weight gain or loss. In this review, we will discuss recent advances of mechanisms through which gut microbiota dysbiosis leads to obesity. We will further discuss the underlying causes of obesity-related gut microbiota, highlighting dietary effects.