Introduction: The educational environment (EE) of medical education is the set of factors of a material and affective nature that permeates the tripod formed by the educational institution, by the teacher and by the student. A healthy environment results in quality learning and, consequently, a professional with a higher level of competence and satisfaction. Objectives: To analyze the educational environment of a medical school public university in Brazil in the view of its students and to investigate the presence of association between the sociodemographic variables of the students and their perceptions about the EE. Methods: A cross-sectional observational study with medical students from four different periods of the course, using the questionnaire DREEM and a sociodemographic questionnaire. Results: 210 students participated. Although DREEM's overall score shows that students have a more positive rather than negative view of EE in general, there was a large discrepancy in results among the groups surveyed, indicating that the more students progress in the medical course, the more negative your view on the educational environment. The perception about the general teaching environment and social relations was negative in the four groups. Female students, white, and those who lived outside Rio de Janeiro before attending in medical school perceived EE more negatively. The perception of EE by students who entered the system of racial or social quotas and those who did not join the quota system was similar. Conclusion: the analysis of the educational environment the students' dissatisfaction with the traditional Flexnerian models. Low-income, self-declared non-white and female students experience more problems and negative