As a kid I used to think that during the Millennium the Savior would stuff Satan into a genie lamp and lock him in a cave for a thousand years until (plot twist!) some rascally bad guy decided to break in and summon the father of lies back from his befittingly cramped domain. Let's call this the Aladdin Doctrine.
The Aladdin Doctrine is false.
In 1Nephi 22:24-26 we're taught that the time will come when Christ will be our ruler, the righteous will be gathered, and in Him we will find pasture. This period of peace is referred to as the Millennium. During this time Satan will have no power over the hearts of the children of men. Nephi plainly explains why this is so: "And because of the righteousness of [Christ's] people, Satan has no power; wherefore, he cannot be loosed for the space of many years; for he hath no power over the hearts of the people, for they dwell in righteousness, and the Holy One of Israel reigneth".
The Book of Mormon has a knack for clarifying truth. The Aladdin Doctrine is contrary to the plan of happiness because it disregards our moral agency. Satan's power depends entirely on our consent. The fate of his kingdom on earth will be determined by whether we choose good or evil. This is likewise with Christ's kingdom; the establishment of the Kingdom of God on earth cannot occur unless we choose to expel Satan from our hearts. Nephi said we can do this by dwelling in righteousness.
We dwell in righteousness when we consciously choose to do good over evil. God endowed Adam and Eve with the power to choose when He commanded them not to eat the fruit of the tree of knowledge of good and evil. Upon giving them this commandment, He added, "nevertheless, thou mayest choose for thyself, for it is given unto thee..." (Moses 3:17). By introducing opposition, God gave Adam and Eve their agency.
But the combination of opposition and agency alone cannot produce righteousness. According to Elder D. Todd Christofferson, "...The intelligent use of agency requires knowledge of the truth" (see: Moral Discipline). When we intelligently use our agency and obey God, we are righteous. "It is impossible for a man to be saved in ignorance" (D&C 131:6). Likewise, it is impossible to be righteous without knowledge of the truth. The Prophet Joseph Smith taught that "a man is saved no faster than he gets knowledge, for if he does not get knowledge, he will be brought into captivity by some evil power in the other world, as evil spirits will have more knowledge, and consequently more power than many men who are on the earth. Hence it needs revelation to assist us, and give us knowledge of the things of God." It's no coincidence that the inauguration of Christ's millennial reign will be accompanied by the revelation of all truth (2Nephi 30:16-18).
However, this doesn't mean that the Lord is going to wait around until everyone is righteous. Nephi taught: "For the time speedily cometh that the Lord God shall cause a great division among the people, and the wicked will he destroy; and he will spare his people, yea, even if it so be that he must destroy the wicked by fire" (2Nephi 30:10-15). Paul taught that "the day of the Lord so cometh as a thief in the night... Therefore let us not sleep, as do others; but let us watch and be sober " (1Thes. 5:2,6).
Some elements of the Aladdin Doctrine are true. As the Revelator taught, Satan will be bound "till the thousand years should be fulfilled: and after that he must be loosed a little season" (Rev. 20:1-3). "And then cometh the battle of the great God; and the devil and his armies shall be cast away to their own place, that they shall not have power over the saints any more at all" (D&C 88:111-115). But to assume that this situation will be forced upon us is inconsistent with the nature of God. Satan will be bound because of the righteousness of the saints.
This is something we must each realize now individually before we can collectively establish millennial peace.