Sleep is supposed to be rejuvenating-so why do you wake up so stiff all the time? Simple: it’s because you’ve just spent eight hours in one position, says Dr Andrew Gitkind, a spinal medicine specialist. That’s why it’s so important to sleep in a position that won’t aggravate any existing aches, especially if you struggle with lower back pain, says physiotherapist  Dr Jennifer Solomon. 

Here’s exactly how you should sleep-and how you shouldn’t-to wake up refreshed and back pain-free.

The best ways to sleep with lower back pain

Your main goal is to keep your spine in a neutral position, which includes your back in relation to your hips and pelvis, Dr Gitkin says. You can achieve this either on your back or your side with a pillow to assist in keeping your spine straight. “The ideal positions are on your back with a pillow underneath your knees or on your side with a pillow in between your knees,” Dr Solomon explains. You’ll also want to be sure to use a supportive pillow.

1. On your side with a pillow between your legs

The Best Way to Sleep When Your Back Hurts

2. On your back with a pillow under your knees

The Best Way to Sleep When Your Back Hurts

The worst sleep position for back pain

Stomach snoozers, listen up: The way you’re sleeping is absolutely terrible for your lower back. Resting your head to the side puts major stress on your cervical spine, or the area at the base of the neck, Dr Gitkin says, and can mess with the alignment of the rest of your spine as well.

If you keep waking up on your belly, Dr Solomon suggests taping tennis balls to your chest. Sounds weird, but it works. “It will be so uncomfortable, that you’ll be forced to flip over,” she explains. It should also help you get used to the new, back-protecting position.

Is it time to replace your mattress?

If you’re already sleeping with good posture and are still waking up with lower back pain, your bed may be to blame. A high-quality mattress should last around 10 years, but it is recommended you replace yours after five if you’re not sleeping well. “Firmer mattresses tend to be better for chronic pain because they provide adequate support,” sleep researcher Dr Michael Grandner told Prevention in a previous interview. Sleeping on a bed for a week or two is the best way to know whether a mattress is right for you, so he recommends buying one with a generous return policy.