Type 2 diabetes mellitus (T2DM), the most common form of diabetes, is a progressive chronic metabolic disease that has increasingly spread worldwide, enhancing the mortality rate, particularly from cardiovascular diseases (CVD). Lifestyle improvement through diet and physical activity is, together with drug treatment, the cornerstone of T2DM management. The Mediterranean diet (MD), which favors a prevalence of unprocessed vegetable foods and a reduction in red meats and industrial foods, without excluding any food category, is usually recommended. Recently, scientific societies have promoted a very low-calorie ketogenic diet (VLCKD), a multiphasic protocol that limits carbohydrates and then gradually re-introduces them, with a favorable outcome on body weight and metabolic parameters. Indeed, gut microbiota (GM) modifications have been linked to overweight/obesity and metabolic alterations typical of T2DM. Diet is known to affect GM largely, but only a few studies have investigated the effects of VLCKD on GM, especially in T2DM. In this study, we have compared anthropometric, biochemical, lifestyle parameters, the quality of life, and the GM of eleven patients with recently diagnosed T2DM and overweight or obesity, randomly assigned to two groups of six and five patients who followed the VLCKD (KETO) or hypocaloric MD (MEDI) respectively; parameters were recorded at baseline (T0) and after two (T2) and three months (T3). The results showed that VLCKD had more significant beneficial effects than MD on anthropometric parameters, while biochemical improvements did not statistically differ. As for the GM, despite the lack of significant results regarding the alpha and beta diversity, and the Firmicutes/Bacteroidota ratio between the two groups, in the KETO group, a significant increase in beneficial microbial taxa such as Verrucomicrobiota phylum with its members Verrucomicrobiae, Verrucomicrobiales, Akkermansiaceae, and Akkermansia, Christensenellaceae family, Eubacterium spp., and a reduction in microbial taxa previously associated with obesity (Firmicutes and Actinobacteriota) or other diseases (Alistipes) was observed both at T2 and T3. With regards to the MEDI group, variations were limited to a significant increase in Actinobacteroidota phylum at T2 and T3 and Firmicutes phylum at T3. Moreover, a metagenomic alteration linked to some metabolic pathways was found exclusively in the KETO group. In conclusion, both dietary approaches allowed patients to improve their state of health, but VLCKD has shown better results on body composition as well as on GM profile.