A door is a hinged or otherwise movable barrier that allows ingress (entry) into and egress (exit) from an enclosure. The created opening in the wall is a doorway or portal. A door's essential and primary purpose is to provide security by controlling access to the doorway (portal). Conventionally, it is a panel that fits into the doorway of a building, room, or vehicle. Doors are generally made of a material suited to the door's task. They are commonly attached by hinges, but can move by other means, such as slides or counterbalancing.
The door may be able to move in various ways (at angles away from the doorway/portal, by sliding on a plane parallel to the frame, by folding in angles on a parallel plane, or by spinning along an axis at the center of the frame) to allow or prevent ingress or egress. In most cases, a door's interior matches its exterior side. But in other cases (e.g., a vehicle door) the two sides are radically different.
Many doors incorporate locking mechanisms to ensure that only some people can open them (such as with a key). Doors may have devices such as knockers or doorbells by which people outside announce their presence. (In some countries, such as Brazil, it is customary to clap from the sidewalk to announce one's presence.) Apart from providing access into and out of a space, doors may have the secondary functions of ensuring privacy by preventing unwanted attention from outsiders, of separating areas with different functions, of allowing light to pass into and out of a space, of controlling ventilation or air drafts so that interiors may be more effectively heated or cooled, of dampening noise, and of blocking the spread of fire.
Doors can have aesthetic, symbolic, ritualistic purposes. Receiving the key to a door can signify a change in status from outsider to insider. Doors and doorways frequently appear in literature and the arts with metaphorical or allegorical import as a portent of change.
The earliest recorded doors appear in the paintings of Egyptian tombs, which show them as single or double doors, each of a single piece of wood.