This aims of this study are to: 1) test efficacy of cognitive-behavioral therapy (CBT) insomnia intervention for youth with migraine and comorbid insomnia, and 2) investigate how changes in sleep may modify response to CBT pain intervention. Participants will include 250 youth and their parents. Youth will be ages 11-17 years, with migraine (with or without aura, chronic migraine) and comorbid insomnia. In Phase 1, participants will be randomly assigned to receive access to internet-delivered CBT insomnia intervention or internet-delivered sleep education control over 6 weeks. In Phase 2, all participants will receive access to internet-delivered CBT pain intervention over 6 weeks. Assessments will occur at baseline, immediately after Phase 1 intervention, immediately after Phase 2 intervention, and 6 month follow-up.