The Halachic obligation to self-quarantine during a plague [and miss Minyan, Mikveh, etc]:
During our current time of crisis due to the Coronavirus outbreak, many are being asked by the medical community to quarantine/isolate themselves from society and not leave their homes, so they do not become infected nor infect others. In many localities [i.e. Israel, New York, California], this is being applied to the entire general populace, whether or not one has the illness, or has been exposed to it. While people who have r”l caught the disease understand the necessity for them to go into isolation, people who have not caught it, and have no known exposure to it, question whether they are Halachically obligated to follow these medical requests by their government, especially if it comes in expense of fulfilling their religious duties, such as Davening with a Minyan, going to Mikveh, and matters of the like. The basis for this form of questioning often lies in complete lack of knowledge of how the Torah instructs one to act at a time of an epidemic. The same way there is no place for religious patriotism for one to fast on Yom Kippur when the doctors warn that fasting for such a person could be lethal, so too, there is no room for religious exemptions to allow defying the instructions of the medical community which are there to help prevent illness and death from oneself, family and neighborhood. All in all, people living in localities in which the Coronavirus has struck are to heed to all instructions and suggestions of the medical community and try as much as possible to remain home, and in isolation from the illness, even in expense of missing religious activities. The following is the Halachic background on this subject and an offering of Jewish perspective.
Quarantine in Halacha:
It is stated in the Talmud, and Poskim and Zohar that during a time of an epidemic, every individual is to go into isolation or quarantine. In the words of the Talmud: “Our Sages taught: When there is a plague in the city, gather your legs [i.e. flee] as the verse states “And you shall not leave the opening of your homes until morning….Rava during times of wrath [Rashi=plague]would close his windows.” In the words of the Alter Rebbe in Hilchos Shemiras Haguf Vehanefesh Halacha 13 “When there is a plague in the city, one should not walk in the middle of the road being that the angel of death walks down the middle of the road, as he now has permission to pass. One is to escape from a city when the plague first begins, although if one did not escape when it began then he should not run away towards its end. Rather he is to hide himself in hidden places and is not to show his face in the marketplace due to the Mazikin, as it says in the verse [regarding the plague that struck Egypt on the night of the 15th of Nissan] “And you shall not leave the opening of your homes until morning.” In explanation for why only in the beginning of the plague one is instructed to leave the city, the Taz [Y.D. 116:5] writes that this is because the disease has already spread and it will no longer help to avoid it by running away, and furthermore, going out into the public can make one susceptible to the disease being that the angel of death now roams the streets without limitation. Indeed, Rav Yosef Caro, the famous author of the Shulchan Aruch fled the city of Tzefas during an outbreak in 1572 and lived in the nearby town of Biriyah during the interim. The famous Kabbalist, Rav Avraham Azulaiy writes: It is implied from the Zohar that the most effective way to escape an epidemic is to seclude oneself in his room and therefore without doubt it is proper for people to seclude themselves during a time of a plague and study Torah, and Hashem will protect him.”
Placing ones family and children in isolation: The Shelah Hakadosh writes that when there is a plague in the city, every individual should help their children escape the city and if they abstain from doing so then they are liable for their souls.
Doctors, paramedics, and people working on the frontlines to help those stricken by the epidemic: Rav Avraham Azulaiy emphasizes that by a long epidemic which lasts 3-4 months, those people who work on the front lines to help the sick and bury the dead are to continue with their holy work and not be worried of the plague and the fact that they are not following the protocol of isolation, as “Shomer Pesaim Hashem.”
Questions in Hashkafah
Why must I quarantine myself and act as if I can run away from G-d’s wrath? If I am meant to get ill r”l it will happen anyways and if not then I will live regardless. Everything has already been decided on Rosh Hashanah and Yom Kippur, so what is the worth of all this running away from reality and sabotaging religious life and activity?
Indeed, this very question has been addressed by the Gedolei Haposkim and Mefarshei Hatorah. Rabbeinu Bechayeh in Parshas Korach explains that making oneself exposed to the illness naturally causes one to become infected by it, and hence even if he was not deserving to initially receive the illness, it does not afford him a protection to not receive it in face of open exposure. A precedent for this can be found in the Torah regarding Lot’s wife, that although she was destined to be saved, because she turned around and exposed herself to the punishment of Sodom she also lost her life. An alternative reason for the requirement to isolate oneself is because Chazal state that in a time that the attribute of judgement is expressed in the world, it does not differentiate between a Tzaddik and Rasha, and hence placing oneself in the face of exposure to the plague can cost him his life even though he was not destined to die.
The Rashbash in Teshuvah 195 was likewise addressed this very question and explained in length that all those written on Rosh Hashanah in the book of life will outlive the epidemic even if they do not escape the city, while all those written in the book of death will die from the epidemic even if they escape the city. However, it is possible that certain people were left in limbo on Rosh Hashanah and Yom Kippur and were not written neither for life or death, and it is for this group of people that running away from the city, and going into isolation can help save their lives. He writes a parable for this matter: A certain state was found to be rebellious against the King and the King decided to send an army to destroy the rebels. He instructed the army to kill all the rebels in the city and search to kill any rebels who ran away into hiding. He likewise instructed that all of his loyal servants are to be protected even if they remain in the city. However, those who are not rebels but are likewise not servants of the King, were not afforded the King’s protection and therefore if they remained in the city they exposed themselves to death.
How is it possible to close Shul’s, Mikvaos, and Minyanim of Tefila. Shouldn’t we have Mesirus Nefesh and trust in G-d, even during times of epidemics?
While it is certainly true that during times of religious persecution, Yidden were Moser Nefesh to learn Torah, congregate in Shul’s for Davening and operate Mikvaos and Talmudei Torah, nonetheless, this is not the case regarding a plague. The same Torah that instructs us by religious persecution to give up our lives for the sake of Hashem and not transgress any of the Mitzvos, also instructs us to transgress the Torah when it involves a medical emergency. So is the ruling of the Poskim in the laws of Yom Kippur that if one is sick, and fasting will place his life in danger, then he must eat. “If he does not do so, he is held responsible for the spilling of his own blood, which G-d will avenge against him.” Accordingly, any and all expressions of Mesirus Nefesh for public religious activity at this time, which contradicts the medical instructions, is a perversion of the true intent of Mesirus Nefesh which is uniquely applied to religious persecution, and on which the Torah instructs to the contrary that he must give up the Mitzvah for the sake of guarding his life.
Was there ever a precedent in Jewish history in which the Shul’s and Mikvaos were closed due to an epidemic?
It is understood from the ruling of the Talmud and Poskim brought above that if people were instructed to isolate themselves at home, or escape the city, that the city was left without any functioning Shul’s and Mikvaos. Furthermore, in the times of the cholera epidemic Rebbe Akiva Eiger instructed certain occupancy restrictions to be followed in the shuls on Rosh Hashanah which left many people unable to attend shul even during the high holidays.
Why would Hashem cause Yidden to not be able to come to Shul and immerse in Mikveh and properly serve Him?
Obviously, we do not know the calculations of Heaven, and what G-d’s intents are. However, certainly every matter is for the best, and hence certainly we must find some positive derivative from this episode, and the possible message that G-d is sending us. When Davening alone, one is able to place more energy into his prayer, spend greater time in Avoda, and Daven aloud without fear of public reaction or disturbance. Perhaps Hashem wants us to focus on a more Penimiyus form of Davening and has hence sent us this message. Certainly, if each individual improves his form of Davening during this time, it will help capitalize on the Gam Zu Letovah that Hashem certainly has in mind.
 Regarding the definition of a plague in halacha: See Michaber O.C. 576:2 regarding establishing a fast day [ratio of 3:500 of the employed population dead in three days and that if there is a plague in all of Israel, all the world fasts and if there is a plague in an area of the world in which people travel to and from, then all destinations of travel must fast]; 576:3 [That even if the plague is by pigs, and certainly by gentiles, one must fast]; M”A 576:2 that today we no longer fast due to danger;
 Hilchos Shemiras Haguf Vehanefesh Halacha 13; Rama Y.D. 116:5; See Zecher David Mamar Alef chapter 39 p. 98
 See Zohar Vayakhel p. 197; Vayeira p. 107b
 Braisa Bava Kama 60b
 Shemos 12:22
 Admur ibid; Taz Y.D. 116:5; Braisa Bava Kama 60b
 Admur ibid; Rama Y.D. 116:5; Maharil 50; Maharshal Yam Shel Shlomo Bava Kama ibid
 Shemos 12:22
 Admur ibid; Bava Kama ibid; Zohar Vayakhel p. 197
 See also Rashal ibid; Iyun Yaakov Bava Kama ibid; See however Torah Temima Shemos 12 footnote 195; Zivcheiy Tzedek 2:116
 Chesed Leavraham Mayan Chamishi Eiyn Mishpat Nehar 28, brought in
 M”A 576:3; Beir Heiytiv 576; M”B 576
 Shaar Haosiyos Erech “Derech Eretz” 14
 Chesed Leavraham ibid
 Brought in Hagahos Rebbe Akiva Eiger Y.D. 116:5
 Bava Kama 60a
 Brought in Pischeiy Teshuvah Y.D. 116:8
 Admur 618:11
 See Igeres Sofrim 29