Kiddush Levana Outdoors

The mitzvah of Kiddush Levanah, sanctifying the new moon with a special brachah at the beginning of every month when it appears anew, should be done outdoors, tachas kipas hashamayim, under the open sky; it should not be done under an overhang, such as a covered porch or balcony. The reason for this is that it is as if we are greeting the Shechinah, Hashem’s Presence, and to show respect we should go out to greet the Shechinah and not stay under a covering to do so. Another reason given is that there may be some form of tum’ah, ritual impurity, under the covered area, and we should do Kiddush Levanah in a place free of impurity. Accordingly, one should not do Kiddush Levanah even under a tree. If a person is too cold or not well, or if the place outside is not clean, they may do Kiddush Levanah indoors looking out at the moon, preferably from an open window. If they cannot open the window, they may do it even next to a closed window. Wearing glasses is not a problem; one can look at the moon through glasses and be mekdeish the levanah.

https://halacha2go.com?number=193

Practical Halacha: One minute a day. By Horav Yosef Yeshaya Braun, shlita, Mara D'asra and member of the Badatz of Crown Heights.