BackgroundThe COVID-19 pandemic continues to impact global health and China requires a 14-day quarantine for individuals on flights with positive COVID-19 cases. This quarantine can impact mental well-being, including sleep. This study aims to examine the impact of psychosocial and behavioral factors on insomnia among individuals undergoing quarantine in hotels.MethodsThis study was a cross-sectional survey carried out in Guangzhou, China. The data was gathered through online questionnaires distributed to international passengers who arrived in Guangzhou on flights and were required to undergo a 14-day quarantine in hotels arranged by the local government. The questionnaires were sent to the participants through the government health hotline "12,320."ResultsOf the 1003 passengers who were quarantined, 6.7% reported significant anxiety and 25.0% had varying degrees of insomnia. Anxiety was positively associated with insomnia (β = 0.92,P< 0.001), while collectivism (β = -0.07,P= 0.036), indoor exercise (β = -0.50,P< 0.001), and the perceived people orientation of the public health service (β = -0.20,P= 0.001) were negatively associated with insomnia. The study also identified moderating effects, such that a higher sense of collectivism, a greater frequency of indoor exercise, and a higher perception of the people-oriented of the public health service were associated with a lower impact of anxiety on insomnia. These moderating effects were also observed in participants with varying degrees of insomnia.ConclusionsThis study reveals that a proportion of people undergoing entry quarantine experience insomnia and confirms how psychosocial and behavioral factors can alleviate insomnia in this population.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12889-023-15340-4.