A bathroom fan generally works more effectively with the door closed. This helps create a pressure differential, allowing the fan to draw air from the room more efficiently. However, if the bathroom is small or lacks adequate ventilation, leaving the door slightly ajar can help promote better airflow.