Our Sages instituted a mitzvah to light candles all eight days of Chanukah, when the Jewish people celebrated and gave thanks to God for helping them defeat the Greeks, liberate Jerusalem, and purify the Holy Temple. In addition, the oil in the Temple’s menorah burned miraculously during those days.
Even though lighting Chanukah candles is a rabbinic mitzvah, we recite a blessing over it: “Blessed are You, Lord our God, King of the universe, Who has sanctified us with His commandments and has commanded us to light the Chanukah candle.” One could seemingly ask, how can we say “He has commanded us,” when the Written Law does not contain such a commandment? [The answer is]: the Torah gives the Sages the authority to institute mitzvot, within the guidelines of the Torah, as it says, According to the torah that they will teach you and according to the judgment that they will say to you, shall you do; you shall not deviate from what they will tell you, right or left (Devarim 17:11). It also says, Remember the days of old, consider the years of generation after generation; ask your father and he will tell you; your elders, and they will say to you (ibid. 32:7) (Shabbat 23a). Thus, in order to remember and publicize the miracle that HaShem performed on our behalf during the Second Temple era, the Sages instituted [a mitzvah] to light candles all eight days of Chanukah.
Women are obligated to keep this mitzvah just as men are. Even though this is a time-bound, positive commandment, from which women are usually exempt, nonetheless, they too must fulfill this mitzvah because women participated in the miracle, as well (Shabbat23a; however, the custom is for married women to discharge their obligation by way of their husband’s lighting; see below note 2, and above 11.11, note 14).
The purpose of all the laws that the Sages instituted regarding where and when to light Chanukah candles is to publicize the miracle. Therefore, they required that the candles be lit near the door or in front of a window facing the main thoroughfare, so that passersby can see them (as will be explained below, 13.1-3). They also determined that the candles be lit after sunset, when the maximum number of people will see them. After all, darkness has already [begun to] descend, making the lights recognizable, and at the same time the streets are still filled with people coming home from work (we will elaborate below, 13.4). Publicizing the miracle, however, is not a necessary prerequisite for the fulfillment of the mitzvah. Even a Jew who lives alone on a deserted island must light the candles, in order to remind himself of the miracle.