Background: Insomnia is a highly prevalent and disabling disorder where Cognitive Behavior Therapy for Insomnia (CBT-I) is established as the best available treatment. Still, only a negligible number of patients with insomnia receive this treatment. One potential way of improving the dissemination of CBT-I is by using online adaptations of CBT-I. This is a new method for delivering CBT-I and it is not known how effective online treatment is compared to face-to-face CBT-I. This trial's purpose is to compare face-to-face CBT-I with online CBT-I. Because of the great advantage of online treatment in both availability and cost, the trial is designed as a noninferiority trial.