Objectives To determine whether insomnia at baseline is a risk factor for new-onset asthma. Methods We recruited 48 871 patients with insomnia (insomnia group) newly diagnosed between 2002 and 2007, and 97 742 matched controls without insomnia (control group) from Taiwan's Longitudinal Health Insurance Database 2000. All of the patients were followed up for 4 years to see whether new-onset asthma developed. Patients with previous asthma or insomnia were excluded. The Poisson regression was used to estimate the incidence rate ratios (IRRs) and 95% CIs of asthma. Cox proportional hazard regression was used to calculate the risk of asthma between the two groups. Results After a 4-year follow-up, 424 patients in the insomnia group and 409 in the control group developed asthma. The incidence rate of asthma was significantly higher in the insomnia group (22.01vs10.57 per 10 000 person-years). Patients with insomnia have a higher risk of developing new-onset asthma during the 4-year follow-up (HR: 2.08, 95% CI 1.82 to 2.39). The difference remained significant after adjustment (adjusted HR: 1.89, 95% CI 1.64 to 2.17). Conclusions This large population-based study suggests that insomnia at baseline is a risk factor for developing asthma.