In this study, we evaluated the quality of life (QoL) and associated factors of community health workers (CHWs) in different urban settings as a contributor to the preparedness of Brazilian primary care for future sanitary emergencies. The sample included 1935 CHWs from 4 state capitals and 4 inland municipalities in northeastern Brazil. Information was collected on QoL (WHOQOL-BREF), work routines, sociodemographics, direct and indirect exposure to violence, general self-efficacy, social support (MSPSS), mental health (SRQ-20) and coronavirus anxiety. The data were subjected to multiple linear regression analysis (α = 5%). In the state capitals, the factors associated with loss of QoL were poor mental health, lack of training, uncertainty about occupational biosafety, and lack of adaptation of services to tend to patients diagnosed with COVID-19. Among the inland municipalities, the main factors were coronavirus anxiety, poor mental health, lack of adaptation of services, lack of training, and lack of personal protective equipment (PPE). A high MSPSS (family and friends) score and self-efficacy had positive impacts on QoL in both urban settings. Our results highlight the need for investment in permanent education, PPE, social support, and mental health care for CHWs.