Just behind the front galley of a Boeing 787 there is a door that looks like a closet. It is not a closet. Behind it is a narrow staircase that climbs into the roof of the aircraft.
At the top is a small room with two flat beds, a pair of seats, a phone line to the cockpit and no windows at all. Passengers sit underneath it for hours without ever knowing it is there.
That room is a large part of the reason an airliner can fly for 18 hours without stopping. Here is what is inside it, who is allowed to use it, and the rules that decide exactly when a pilot may close their eyes.
Where Do Pilots Sleep on Long Flights?
On any flight long enough to carry more than the minimum two pilots, the pilots sleep in a dedicated crew rest compartment. On most modern widebodies that compartment is a sealed room built into the crown of the fuselage, in the empty space above the passenger cabin ceiling.
They sleep in shifts, in a bunk that lies flat, behind a door that is deliberately easy to miss. On widebody flights that fall just short of needing a bunk, the rest happens instead in a curtained-off business class seat.
At a glance
Long-haul aircraft carry extra pilots so that each one can leave the flight deck and sleep in flight. The best rest facilities are lie-flat bunks in a private compartment above the cabin, separate from both the flight deck and the passengers. US rules grade those facilities into three classes, and the class fitted to the aircraft directly sets how long a crew is legally allowed to work that day. At least one qualified pilot is at the controls the entire time.

The Bedroom in the Crown of the Fuselage
An airliner’s fuselage is a tube, and the passenger cabin is a flat-floored box inside that tube. The curved space above the cabin ceiling, known as the crown, is mostly full of ducting and wiring and otherwise wasted.
Crew rest compartments live there because the alternative is worse. Every bunk placed on the main deck costs an airline paying seats, and every bunk placed below the floor costs it cargo revenue.

On the 787 the flight crew compartment sits immediately behind the first pair of main deck exits, reached by stairs through a small vestibule. It holds two berths and up to two seats, and no more than four trained crew members at a time.
Boeing had to obtain special FAA approval to build it there at all, because the airworthiness rules of the day simply had no standards for a compartment outside the passenger cabin. A second set of conditions was needed to let two pilots occupy it during taxi, takeoff and landing.
The Boeing 777 does much the same thing further forward. A concealed door and a steep staircase near the flight deck lead to a compartment with two bunks and two seats, and in some layouts its own lavatory and cold drinks storage.
Airbus follows the same logic. On the A350 the pilots get a two-bunk compartment above the forward galley, while the cabin crew climb to a separate module in the crown above the rear of economy, typically six bunks arranged around the top of the stairs.
The A380 is the exception that proves the rule. Its cabin crew rest is usually a 12-berth module fitted below the main deck, in space that would otherwise be sold as cargo, reached by a narrow stairwell that starts in the middle of the economy cabin.
One detail surprises most passengers: pilots and cabin crew almost never share a compartment. They are separate rooms, usually at opposite ends of the aircraft, because the flight crew area sits inside the secure zone around the cockpit.
Sleeping Is a Legal Requirement, Not a Perk
None of this is hospitality. Under US rules, an airline that wants to fly longer than a two-pilot duty day allows must carry an augmented flight crew, meaning more pilots than the aircraft’s type certificate requires, specifically so that each of them can be relieved and rest in flight.
Federal Aviation Regulations Part 117 then grades what the pilot is resting on. A Class 1 facility is a bunk allowing a flat sleeping position, separate from both the flight deck and the passenger cabin, temperature controlled, with light the occupant can switch off and isolation from noise and disturbance.
A Class 2 facility is a cabin seat that lies flat or nearly flat, screened from passengers by at least a curtain. A Class 3 facility is simply a seat that reclines at least 40 degrees with leg and foot support, and it can be on the flight deck itself.

That grading is not paperwork. The class of facility on board, combined with the number of pilots, sets the maximum length of the working day, so the quality of the bed decides how far the aircraft can fly.
| Rest facility | What it actually is | Longest duty day, four pilots |
|---|---|---|
| Class 1 | A flat bunk in its own compartment, away from the flight deck and cabin, with its own light and temperature control | 19 hours |
| Class 2 | A flat or near flat cabin seat, screened from passengers by at least a curtain | 18 hours |
| Class 3 | A seat reclining at least 40 degrees with leg and foot support | 15 hours 30 minutes |
A proper bed is worth three and a half hours
Fit the same four-pilot crew with a Class 3 reclining seat instead of a Class 1 bunk and their legal duty day shrinks from 19 hours to 15 hours 30 minutes. That gap is why airlines pay to build a bedroom into the roof: without it, the ultra-long-haul routes they want to fly do not close on paper.
The rules also dictate who sleeps when, not just how long. The pilot who will fly the landing must have two consecutive hours of rest available in the second half of the duty period, and the pilot monitoring during landing must have 90 consecutive minutes.
In practice that inverts the intuitive order. The crew who took off will usually rest first, and the crew who will bring the aircraft down are put to bed late, deliberately, so that they wake into the approach rather than out of it. The full framework of duty limits sits in our guide to airline crew rest rules.
Rest in flight also does not buy unlimited flying. An augmented crew is still capped at three flight segments in the duty period, and the wider limits on how long pilots can fly per day continue to apply on top.
What It Is Actually Like Up There
Crew who use these compartments tend to describe them the same way: a capsule hotel with better soundproofing. Each bunk has a padded mattress, a privacy curtain, a reading light and a power outlet, and the compartment has its own temperature control.
What it does not have is a window, or standing headroom. You climb in, you lie down, and you stay lying down, with a restraint fitted so that turbulence does not throw you out of the bunk.
The safety engineering behind that small room is disproportionate to its size. The FAA’s conditions for the 787 compartment require smoke detection that alerts the flight deck within one minute, two-way voice communication with both the cockpit and the cabin crew stations, and two independent escape routes.
Those escape routes have to be usable in the worst case. The design must allow an unconscious crew member the size of a 95th-percentile male to be removed from the compartment, down the stairs, by the people left awake.
The compartment is also acoustically isolated from the public address system, which is filtered so that routine cabin announcements never reach the sleeping crew. Only an emergency call gets through.
On the genuinely long routes, the rest is carved into blocks rather than taken in one go. Singapore Airlines crews its roughly 18-hour Singapore to New York services with four pilots, two captains and two first officers, each taking a longer rest of around four hours and a shorter one of about two and a half.
The next generation of these flights is being designed around the bunk from the outset. Qantas plans to fly Sydney to London nonstop from October 2027 using A350-1000ULRs configured with just 238 seats, a lower density than any other A350 in service.
Some of that space goes to crew facilities on a sector approaching 22 hours. When it launches it will comfortably reset the record described in our guide to the longest flight in the world.
The Myth: Nobody Is Flying the Plane
The idea of pilots asleep in a bed lands badly with a lot of passengers, and the mental image is usually wrong in the same specific way.
The myth
While the pilots are in the bunks, the aircraft is flying itself with an empty flight deck. In reality a crew member only goes to rest because a fully qualified replacement has taken their seat first. The regulation is explicit that a pilot qualified to operate the aircraft must be at the flight controls at all times.
An augmented crew is two overlapping teams, not one team taking a break. When the operating pair hands over, a relief captain or relief first officer is already strapped in and briefed, and the cockpit is never left with fewer people than the aircraft is certified to need.

There is a second, more interesting split in the rules, and it has nothing to do with bunks. Many regulators allow controlled rest, a short, planned nap taken by one pilot in their own seat on the flight deck while the other flies.
A typical controlled rest profile is a briefing of about ten minutes, a nap of no more than 40 minutes, then at least 20 minutes to shake off grogginess before the pilot resumes duties. Europe, Canada, Australia, New Zealand and China are among the jurisdictions that permit it.
The FAA does not. US airline pilots may not nap in the seat at all, even though the FAA’s own guidance acknowledges that naps of 25 to 30 minutes improve alertness, and even though the US Coast Guard and Air Force allow the practice.
It is one of the sharper disagreements in international flight safety policy. It also sits alongside the separate question of when pilots can leave the cockpit during flight.
So on a US carrier, a tired pilot has two options: a proper bed in a certified compartment, or nothing. The bunk is not a luxury the airline threw in. It is the only legal way for that pilot to sleep.
Next time you board a widebody, look at the wall just behind the forward galley, or the panel above the last rows of economy. If there is a door with a keypad and no obvious purpose, you have found the staircase.
Somewhere above your head, for most of the flight, someone is asleep in the roof of the aircraft. That is not a lapse in the system. It is the system working exactly as designed.
Sources and references used for research and fact-checking.
- Cornell Law School Legal Information Institute, 14 CFR 117.3 - Definitions
- Cornell Law School Legal Information Institute, 14 CFR Appendix Table C to Part 117 - Flight Duty Period: Augmented Operations
- Cornell Law School Legal Information Institute, 14 CFR 117.17 - In-flight rest facility
- Federal Register (U.S. Government Publishing Office), Special Conditions: Boeing Model 787-8 Airplane; Overhead Flightcrew Rest Compartment Occupiable During Taxi, Take-Off, and Landing
- Flight Safety Foundation, AeroSafety World, Controlled Rest
- Simple Flying, Inside The Boeing 787 Dreamliner's Crew Rest Area
Get the Newsletter
The latest aviation news and stories sent to your inbox.
About the Author
Tim is the owner and lead editor of AeroCorner since 2019, overseeing aviation content covering aircraft, airlines, airports, and the broader aviation industry. Through years of researching, writing, editing, and publishing aviation-focused content, he has developed extensive practical knowledge of commercial aviation and air travel. Based in Asia and a frequent traveler himself, Tim also brings firsthand passenger experience to AeroCorner’s coverage. Outside of publishing, he has also explored aviation firsthand through hands-on flight training in New Zealand.