This study described the occurrence of food deserts and its relationship with the socioeconomic characteristics of the area. This is an ecological study based on secondary data from the city of Porto Alegre/Brazil. Food deserts were defined based on the density of establishments that sell healthy foods. The socioeconomic variables analyzed were the Health Vulnerability Index, percentage of illiterate people, percentage of people with per capita income of up to half a minimum wage, and percentage of households made up of people who identify as Black, Brown, or Indigenous. Statistical and spatial analyses were conducted using census tracts as units of analysis. Almost half of the census tracts were classified as food deserts (n = 1150/48.3%), with higher concentration in the peripheral areas of the city. Tracts with a high risk of health vulnerability (very high HVI), those with the highest percentage of black and indigenous peoples (Quartile 4), the highest percentage of illiterate people (Quartile 4), and the highest percentage of people living on less than ⅕ minimum wage (Quartile 4), were about twice as likely to be classified as a food desert. For all variables, a dose-response relationship was observed. The results show that in the city of Porto Alegre food deserts were associated with worse environmental and social conditions, and a greater presence of ethnic-racial minority groups. Social and ethnic-racial inequities might shape the city environment, making access to healthy foods more difficult for the most vulnerable populations, with possible repercussions on food consumption, food security and other health outcomes.