To evaluate association of vitamin D with sleep quality in adults and the influence of VDR-gene polymorphism FokI (rs2228570;A > G). Cross-sectional population-based study in adults, conducted in Brazil. The outcome was sleep-quality, evaluated by the Pittsburgh Sleep Quality Index. Vitamin D was determined by indirect electrochemiluminescence and classified as deficiency (VDD), 25(OH)D < 20 ng/mL in a healthy population or 25(OH)D < 30 ng/mL for groups at risk for VDD. FokI polymorphism in the VDR-gene was genotyped by qPCR and classified as homozygous wild (FF or AA), heterozygous (Ff or AG), or homozygous mutant (ff or GG). Multivariate logistic analysis was used to estimate the association between vitamin D and FokI polymorphism with sleep-quality. In a total of 1674 individuals evaluated, 53.6% had poor-sleep-quality, 31.5% had VDD, and the genotype frequency of the FokI polymorphism was 9.9% FF, 44.6% Ff, and 45.5% ff. In multivariate analysis, individuals with VDD had 1.51 times the chance of poor-sleep-quality, and individuals with the ff genotype had 1.49 times the chance of poor-sleep-quality (OR:1.49;95%CI:1.05–2.12) when compared to individuals with the FF or Ff genotype. In the combined analysis, individuals with VDD and ff genotype had more chance of poor-sleep-quality than individuals with sufficient vitamin D and genotype Ff or FF (OR:2.19;95%CI:1.27–3.76). Our data suggest that VDD and VDR FokI gene polymorphism are associated with poor-sleep-quality, and combining the two factors increases the chance of poor-sleep-quality compared to separate groups.