Sleep deprivation can trigger migraine, and migraineurs often choose to sleep to relieve headaches during acute migraine. This study aimed to explore the effect of acute sleep deprivation on hyperalgesia induced by nitroglycerin in mice. In part one, after either 6-hour sleep deprivation or 6-hour normal sleep, mice were intraperitoneally injected with nitroglycerin or saline. The mechanical pain threshold and withdrawal latency of the hindpaw were measured every 30 minutes for 6 hours. Next, the same sleep deprivation and injection procedure was performed with new mice, and mice were sacrificed 4.5 hours after injection. The trigeminal nucleus caudalis and upper cervical spinal segments were taken for immunofluorescence Fos staining. In part two, after injection of saline or nitroglycerin, the mice were either deprived of sleep for 6 hours or allowed to sleep without interference. The mechanical and thermal pain threshold were measured after 6 hours. In part three, we compared the sleep time of mice after intraperitoneal injection of saline or nitroglycerin without interference. Sleep deprivation for 6 hours did not cause any changes in the baseline pain thresholds in mice. However, pretreatment with 6-hour sleep deprivation significantly prolonged the duration of hyperalgesia induced by nitroglycerin. Additionally, the expression of Fos at 4.5 hours was significantly higher in the 6-hour sleep deprivation and nitroglycerin group than in the other three groups. When intraperitoneal injection was given first, the mechanical pain threshold of the hind paw was significantly lower in the group that received nitroglycerin with 6-hour sleep deprivation than in the other groups. Compared to the saline injection, one-time nitroglycerin injection would result in a significant increase in sleep latency and decrease in sleep duration for the normal mice. Acute sleep deprivation significantly aggravated the hyperalgesia induced by nitroglycerin in mice, which highlights the importance of sleep disorders for migraine.