Sleep Apnea Migraine Headaches—CPAP Stopped Mine

For years I had migraines that took entire days away from me. They were not the headaches my friends complained about. They were attacks that left me lying in a dark room with the door shut, unable to read, unable to look at a screen, unable to do anything except wait for it to pass. Sometimes I vomited. Always I lost the day.
I had no idea sleep apnea was the cause. Neither did my doctor. It took years of escalating symptoms before anyone connected the two. Once we did, the migraines stopped.
This page is the story of how that happened, what the mechanism appears to be, and why the connection between sleep apnea and migraine often gets missed even though it is well documented in headache medicine.
A note before I go further. I write about sleep apnea from the perspective of a long term CPAP user, not a clinician. My background is in computer science. Everything on this page is my experience and my reading of the published literature. If you suspect you have sleep apnea, the way to find out is a sleep test. The way to treat migraine is to work with a doctor. This page is here in case it helps you make a connection that nobody made for me until very late.
The Sydney Hostel
I’ll start with the snoring, because that is where this really begins.
In 2001 I was backpacking and ended up in a shared dorm at a hostel in Sydney. I crashed early after a long day. Sometime in the middle of the night I was woken up by another guest in the dorm shouting at me to stop snoring. He was furious. I had clearly been at it for hours and ruined his night.
I packed up at first light, checked into a hotel the next morning at my own expense, and spent the rest of that trip booking single rooms wherever I went. I was embarrassed. I knew I snored. I did not know how bad it had become, and I had no framework at all for understanding what it meant.
What I now know is that I had untreated obstructive sleep apnea, probably moderate at that point, and it was already changing the shape of my sleep. What I did not know, and would not know for years, was that it was also quietly setting up a different problem that would not show its true face until much later.
The Migraine Years
Skip forward to the early 2010s. I was working long hours. I was snoring like a freight train, according to my wife. And I was being flattened by migraines several times a week.
A migraine, for anyone who has only ever had a bad headache, is a different animal. It is not pain you can work through. It is pain that takes your day apart. Light hurts. Sound hurts. Movement makes the nausea worse. You cannot think clearly enough to make a decision. You go to bed in the dark and you stay there. My wife checked on me when she could. The rest of the time I just lay still and waited for it to pass.
Over the counter painkillers did very little. I tried different ones, in different doses, at different points in the headache. Nothing made a real difference. I went to my GP. I described what was happening. The advice was reasonable enough on its own terms. Manage triggers. Watch screen time. Hydrate. Sleep more.
Sleep more. That part is not unintentional.
The thing that nobody asked me about, the thing that I never thought to volunteer, was the snoring. Snoring happens at night. Migraines happen in the morning. Unless someone is specifically looking for the pattern, there is no obvious reason to connect them. I did not connect them. My GP did not connect them. So the migraines continued, and they got worse, and the years passed.
My Wife Pushed Me to Get Tested
The breakthrough did not come from a doctor in the end. It came from my wife. She had been listening to me snore and stop breathing for years at that point. She was the one who eventually said, in plainer language than I am using here, that the snoring was no longer a comfort issue for her and a punchline for me. It was something that needed to be looked at properly.
I booked a sleep study. I went in expecting to be told I snored badly and should probably lose some weight.
What I was told instead was that my AHI was 51. That number is the Apnea Hypopnea Index, the standard measure of sleep apnea severity. It counts the number of times per hour your breathing either fully stops or becomes severely shallow. Five to fifteen is mild. Fifteen to thirty is moderate. Anything above thirty is severe. I was at 51. My blood oxygen saturation was dropping to 78 percent during these events. Normal sleeping oxygen is in the high 90s.
In plain language, my airway was collapsing more than fifty times an hour, every hour, every night, for years. My brain was being repeatedly starved of oxygen for the duration of every sleep I had ever had as an adult.
The diagnosis was severe obstructive sleep apnea. The full story of how that played out across my life is on a separate page, Living With Sleep Apnea. For this page what matters is what happened next with the migraines.
What the Apnea Was Doing to My Brain
It is worth pausing for a moment to explain what is actually happening to the brain during an apnea event, because this is the bit that connects to migraine.
When your airway closes, oxygen stops getting into your blood and carbon dioxide starts to build up. The brain notices both, and not gently. To compensate, the blood vessels in the brain dilate, trying to keep enough blood flowing to where it is needed. When you finally take a breath again, gas levels begin to reset. Then another apnea happens, and the cycle repeats. Across a full night, the cerebral circulation is being stretched and contracted on a loop. Carbon dioxide is sloshing up and down. Inflammatory signaling is being triggered repeatedly.
The result is a brain that wakes up in a chemically irritated state. For many people this presents as a dull morning headache. For some, including me, it presents as a full migraine attack.
The American Migraine Foundation has documented the relationship between sleep and migraine, noting that sleep apnea is more prevalent in people with chronic migraine, morning headaches, and excessive daytime sleepiness. The foundation also notes that treating the underlying sleep disorder can be an important step in comprehensive migraine care.
That matches my experience exactly.
The First Two Nights on CPAP
I was prescribed a ResMed AirSense 10 and a ResMed AirFit F20 full face mask. The full face mask was an obvious choice because I am a chronic mouth breather. The clinic set the starting pressure based on the data from my sleep study.
The first night was not comfortable. The pressure setting felt high, like a tornado blowing into my face every time I tried to breathe in. I pulled the mask off. Put it back on. Slept some. Woke up. Slept some more. I got through to morning but the sleep was not good.
What was strange was how my chest felt when I woke up. It was a heaviness, like my heart had been working too hard against the air pressure all night. It was uncomfortable enough that I called the clinic and described it. They listened, reduced my pressure settings, and sent me home to try again.
The second night was completely different. I slept through it. The mask was tolerable. The air felt more like steady support than a hurricane. When I woke up in the morning, something was missing that had been part of my mornings for years.
I waited for the throb behind my eyes. It did not come. I waited for the slow dizziness when I sat up. It was not there. My head was clear. My breathing was easy. I checked the machine’s app and my AHI was under 4 for the night.
From 51 to under 4, in one night, once the pressure was right.
I knew immediately that the migraine I had been bracing for had not arrived. I did not yet know that this was going to keep being true.
More Than a Decade
That was a long time ago now. More than a decade. I am still on the same kind of setup, just on my second machine. The first AirSense 10 ran for the better part of four years before a bearing in the motor finally gave out. I replaced it with another AirSense 10 and have been on that one ever since. I am considering a move to the AirSense 11 at some point but for now my routine works and I am in no rush to change it.
In all that time, with the machine running every night, I have not had a single one of those crushing migraines. Not on a bad sleep night. Not on a hot Perth summer night when the bedroom is uncomfortable. Not after a long flight. Not after the kind of high stress day that would have absolutely guaranteed one in the years before treatment.
That is not normal, and I want to be honest about that. Most people who have sleep apnea related morning headaches report a gradual improvement on CPAP over weeks or months, not an overnight reset. My response was unusually clean because my migraines, in retrospect, were almost entirely driven by overnight oxygen deprivation. There were not other major triggers in play. Once the oxygen problem was solved, the migraines simply had no reason to fire.
If your migraines have multiple drivers, treating sleep apnea may reduce them rather than eliminate them. That is still a major improvement worth pursuing.
Why the Connection Gets Missed
There is good evidence in the headache literature for what I went through. The journal Headache, the leading peer reviewed journal in this area, has carried multiple papers over the years on the prevalence of sleep disordered breathing in patients with morning headache and migraine. The clinical recommendation, in patients with morning headaches and risk factors for sleep apnea, is to investigate sleep apnea. The mechanism is not controversial. It is just not, in my experience, asked about often enough.
So why did nobody connect it for me sooner?
A few reasons, I think.
The first is that primary care appointments are short, and migraine has many recognized triggers. Stress. Screens. Alcohol. Hormones. Foods. Hydration. Sleep schedule. By the time you have worked through the obvious ones, the clock is up. Sleep apnea is a different conversation that needs a sleep history and ideally a witness from someone who sleeps next to you. That conversation does not happen in ten minutes.
The second is that sleep apnea is still very much underdiagnosed worldwide. The estimates vary depending on the study, but a large proportion of people who have it have never been tested. If a condition is widely underdiagnosed, it is also widely underconsidered, including by clinicians who would otherwise have a reason to ask.
The third is structural. Snoring and morning migraine present as two unrelated complaints to the patient. You go to the doctor about the migraines. You complain to your partner about the snoring. The two streams do not naturally cross unless someone with a wider view crosses them for you.
What to Do If Any of This Sounds Familiar
If you wake up regularly with a headache or a migraine, and you snore, and especially if your partner has ever noticed you stop breathing or gasp during sleep, get tested for sleep apnea before you do anything else for the headaches.

A home sleep test is not a hard thing to do. You wear a small device for one to three nights in your own bed. It records airflow, oxygen saturation, heart rate, and sometimes more. The data is read by a sleep physician. The results tell you whether you have sleep apnea and roughly how severe it is. From there, treatment is mostly a question of which device, what pressure, and what mask.
The cost in time is small. The cost in money is small relative to the cost of years of migraines, ongoing painkillers, ongoing lost productivity, and the broader health risks of untreated sleep apnea, which are not nothing. Untreated severe sleep apnea is associated with elevated blood pressure, increased cardiovascular risk, daytime sleepiness related accidents, and cognitive decline over time. The migraines are only one piece of a larger picture.
I am not going to pretend CPAP is easy. The first weeks are an adjustment. The mask takes getting used to. The machine takes a place on your nightstand and becomes a permanent part of your bedtime routine. There is a learning curve. There is an emotional adjustment. I have written about CPAP anxiety elsewhere on the site because it is real and worth taking seriously rather than glossing over.
But the trade is favorable. A machine that hums quietly through the night, in exchange for proper sleep, proper oxygen, and, in my case, the end of a years long migraine problem.
Closing Thought
What still gets me, looking back, is how slow the connection was to form. The migraines were happening. The snoring was happening. The breathing pauses were happening. The pieces were all there. Nobody, including me, put them together.
If you are in the same position now, this page is the connection. Get a sleep test. If you have sleep apnea, treat it. The migraines may resolve, or they may improve, or they may turn out not to be the apnea at all. You will not know until you test. And if they are the apnea, you will probably wish you had tested sooner.
⚠️ MEDICAL DISCLAIMER This blog provides general information only and is not a substitute for professional medical advice, diagnosis, or treatment. Sleep apnea is a serious condition, and CPAP equipment should be used under proper medical supervision. Always consult your doctor or sleep specialist before starting, stopping, or changing any therapy. I share personal experiences as a CPAP user, not as a medical professional. Individual results vary. For medical guidance, please consult a qualified clinician or the American Academy of Sleep Medicine (aasm.org).