The substantial burden of colorectal cancer and increasing trend in young adults highlight the importance of lifestyle modification as a complement to screening for colorectal cancer prevention. Several dietary and lifestyle factors have been implicated in the development of colorectal cancer, possibly through the intricate metabolic and inflammatory mechanisms. Likewise, as a key metabolic and immune regulator, the gut microbiota has been recognized to play an important role in colorectal tumorigenesis. Increasing data support that environmental factors are crucial determinants for the gut microbial composition and function, whose alterations induce changes in the host gene expression, metabolic regulation, and local and systemic immune response, thereby influencing cancer development. Here, we review the epidemiologic and mechanistic evidence regarding the links between diet and lifestyle and the gut microbiota in the development of colorectal cancer. We focus on factors for which substantial data support their importance for colorectal cancer and their potential role in the gut microbiota, including overweight and obesity, physical activity, dietary patterns, fiber, red and processed meat, marine omega-3 fatty acid, alcohol, and smoking. We also briefly describe other colorectal cancer-preventive factors for which the links with the gut microbiota have been suggested but remain to be mechanistically characterized, including vitamin D status, dairy consumption, and metformin use. Given limitations in available evidence, we highlight the need for further investigations in the relationship between environmental factors, gut microbiota, and colorectal cancer, which may lead to development and clinical translation of potential microbiota-based strategies for cancer prevention.