Skip to content

Closing Windows and Doors at Night

almahmud edited this page Aug 6, 2025 · 1 revision

Closing Windows and Doors at Night

With the summer heat building, a lot of people ask about opening the window at night - is it allowed Islamically or not? There are two partial answers in English available on IslamQA:

  1. Is it recommended to close the house doors at night?
  2. When the wings of the night spread, keep your children indoors

However, there is a third answer on the site which is only currently available in Arabic, and which provides a better answer to the specific question of keeping the window open at night. What follows is a translation of that answer...


Question: We have heard that we must close the doors and windows at sunset, so that the jinn and the devils do not enter; does this mean that they must stay closed for the whole of the night, or only at sunset? If only at sunset, then exactly how long should they remain closed for?

Answer: All praise is for Allah.

It was narrated from Jabir ibn ‘Abdullah (may Allah be pleased with him) that the Prophet (may the peace and blessings of Allah be upon him) said:

"In the first part of the night – or when evening comes – keep your children in, for the devils come out at that time. Then when part of the night has passed, let them go. And close the doors and mention the name of Allah, for the shaytaan does not open a closed door. And tie up your waterskins and mention the name of Allah, and cover your vessels and mention the name of Allah, even if you only put something over them, and extinguish your lamps." [al-Bukhari narrated it, no. 3280, and this is his wording, as did Muslim, no. 2012].

In another wording reported by al-Bukhari [no. 5624]:

"Put out your lamps when you go to sleep, close the doors, tie up your drinking vessels, and cover your food and drink."

In the wording reported by Ahmad [no. 14747]:

"Cover your containers, tie up your drinking vessels, close the door, and put out your lamps when you sleep, for it may be that a mouse pulls at the wick and burns down the house, and keep your children in when evening comes, for the jinn spread out and snatch."

Also narrated by Ahmad [no. 14597]:

"Close the doors at night, put out the lamps, tie up the drinking vessels, and cover food and drink, even if you only put a stick over them."

These hadeeth, along with those of similar meaning, are evidence for two things:

Firstly, that it is legislated for us, when night comes, to stop our children (likewise, animals including camels, sheep, etc.) from going out. This is because it is a time in which the devils spread out across the earth, and children and animals are not safe from their harms.

Secondly, shutting the doors of the house and its rooms, as well as the windows at night, if there is no reason to open them, especially when you want to sleep.

So, preventing the children from going out is for the beginning of the night; as for shutting the windows and doors, it is for the whole night, not only the beginning, as long as there is no reason to open them. This is a protection for the house and its people from the devils entering the house, as well as from the vermin that would harm the occupants.

Ibn 'Abdul Barr said [al-Istidhkar 8/363]:

Imam Ibn Abd al-Barr (may Allah have mercy on him) said:

"In this hadeeth there is a command to close doors of houses at night. This is a Sunnah which is enjoined to protect people against the devils of mankind and the jinn…"

Ibn Battal said [in his explanation of Saheeh al-Bukhari 67/9]:

"[The Prophet's] command (may the peace and blessings of Allāh be upon him) to close the doors at night was in fear of the devils spreading out and ??gathering?? to frighten the believers and harm them."

It is not right for a Muslim to be excessively strict with himself in this, such that he thinks that from 'ishaa until fajr he has to keep every single window and door in the house closed, and such that whenever he sees that anyone from his household has opened a window, he scolds them, and similar examples of those who you fear will be harsh towards their families. Rather, it should be said that every door that doesn't need to be open at night should be closed, likewise the windows and patio doors. Whichever of them is opened for a need, there is no harm in opening it, but it should be closed when there is no longer a need. This is especially important when you want to go to sleep, and this protects the sanctity of the house from the devils amongst jinn and men.

So, if the people of the house want to open a window, for example, because of the severity of the heat, whilst keeping the house secure, there is no harm in doing so. Likewise, if there is a particular reason to keep a certain door open because of the number of people coming in and out, there is no harm in opening it, but whenever the need ceases, it is to be closed and bolted.

Allāh knows best.

Clone this wiki locally