Astronauts can attach their sleeping bags to a wall or a ceiling, and sleep anywhere as long as they don’t float around and bump into something. They Block Out Light. If there are not enough of these for everyone on board, an astronaut can sleep in one of the ISS modules. While in space, astronauts need their beauty sleep too. Haise says the zero gravity sensation doesn’t really affect sleep quality, though it feels weird not having a bed pressing against your body’s pressure points – it’s a bit like letting your limbs relax while floating in a pool. Most astronauts choose to sleep as closely to how they would on Earth, in sleeping bags tethered to the floor, the walls, or the ceiling.

Astronauts typically sleep in canvas sleeping bags tethered to the wall in their living quarters, according to NASA.

Many astronauts have to take pills to help them sleep. In space there is no up or down, and you do not feel the pull of gravity. But remember—even free arms need to be strapped down to avoid their hovering while the space traveler is asleep. As a result, astronauts are weightless and can sleep anywhere. On the International Space Station (ISS), most of the crew sleep in their own small cabins. Space Station crews usually sleep in sleeping bags.
They also might sleep strapped into a seat. In fact, sleeping pills make up almost half of all the medicines used while in space. Astronauts can attach themselves to a wall, a seat or a bunk bed inside the crew cabin so they don't float around and bump into something. The catch is that they need to tether themselves to something to avoid floating away in the air currents.

Even with the help of medicines, Shuttle astronauts don't get as much sleep a night as they usually do while on Earth.

To mimic the feeling of sleeping on Earth, many astronauts sleep in sleeping bags that are tethered to the floor or wall.