Short answer
It depends on your situation. Hanafi scholars allow living in a non-Muslim country when you can practise your religion openly and protect your family's faith, and moving there for study, work or safety is permitted on those conditions. If a place stops you practising Islam and you can leave, you should. Settling there only for comfort while putting your children's faith at risk is discouraged.
Hijrah (emigration) is obligatory only on someone who cannot practise the basics of Islam where they live and is able to move. Living in a non-Muslim country is permissible for a valid need such as livelihood, study or safety, provided one can pray, eat halal and raise one's family as Muslims. Deobandi scholars, including Mufti Taqi Usmani, add that settling there purely for worldly luxury while exposing one's family to loss of faith is blameworthy.
The four schools agree on this.
Explanation
The Quran criticises those who stayed in a place where they could not live as Muslims although they could have moved: "Was not the earth of Allah spacious enough for you to emigrate?" That is the basis for the duty of hijrah. The scholars agree that it is obligatory when a person is prevented from practising Islam and is able to leave, and most hold that otherwise staying is allowed.
The first Muslim emigrants went to Abyssinia, a Christian kingdom, with the Prophet's ﷺ approval, because they were safe there and free to worship. Muslims have lived as minorities in many lands ever since.
- Refugees and those forced to move: clearly permitted.
- Moving to spread Islam or serve the community: praiseworthy.
- Moving for work, study or a better living: permitted, with care for your faith and your family's.
- Moving because you prefer their way of life to Islam: blameworthy, and dangerous for faith.
Conditions that make living there sound: you can pray, fast, wear hijab and eat halal; you live near a mosque or Muslim community; your children learn the Quran and Islamic manners; and your income is halal. Muslims who live in a country under its laws should keep their agreements, pay what is owed and be honest citizens, as the Quran says "fulfil every commitment". See paying taxes in a non-Muslim country and relations with non-Muslims.
Whether you personally should move or stay depends on your family, work and local community, so ask a scholar who knows your situation.
Ask a mufti about your own case. This answer explains the general ruling. When the details of your situation matter, as they do here, ask a qualified mufti and give them the full facts. Where to ask a scholar.
The evidence
Quran, Surah An-Nisaa 4:97
إِنَّ ٱلَّذِينَ تَوَفَّىٰهُمُ ٱلْمَلَٰٓئِكَةُ ظَالِمِىٓ أَنفُسِهِمْ قَالُوا۟ فِيمَ كُنتُمْ ۖ قَالُوا۟ كُنَّا مُسْتَضْعَفِينَ فِى ٱلْأَرْضِ ۚ قَالُوٓا۟ أَلَمْ تَكُنْ أَرْضُ ٱللَّهِ وَٰسِعَةًۭ فَتُهَاجِرُوا۟ فِيهَا ۚ فَأُو۟لَٰٓئِكَ مَأْوَىٰهُمْ جَهَنَّمُ ۖ وَسَآءَتْ مَصِيرًا ﴿٩٧﴾
Indeed, those whom the angels take [in death] while wronging themselves - [the angels] will say, "In what [condition] were you?" They will say, "We were oppressed in the land." The angels will say, "Was not the earth of Allah spacious [enough] for you to emigrate therein?" For those, their refuge is Hell - and evil it is as a destination.
Hijrah is required of those who cannot practise Islam where they are and can move.
Quran, Surah An-Nisaa 4:100
۞ وَمَن يُهَاجِرْ فِى سَبِيلِ ٱللَّهِ يَجِدْ فِى ٱلْأَرْضِ مُرَٰغَمًۭا كَثِيرًۭا وَسَعَةًۭ ۚ وَمَن يَخْرُجْ مِنۢ بَيْتِهِۦ مُهَاجِرًا إِلَى ٱللَّهِ وَرَسُولِهِۦ ثُمَّ يُدْرِكْهُ ٱلْمَوْتُ فَقَدْ وَقَعَ أَجْرُهُۥ عَلَى ٱللَّهِ ۗ وَكَانَ ٱللَّهُ غَفُورًۭا رَّحِيمًۭا ﴿١٠٠﴾
And whoever emigrates for the cause of Allah will find on the earth many [alternative] locations and abundance. And whoever leaves his home as an emigrant to Allah and His Messenger and then death overtakes him - his reward has already become incumbent upon Allah. And Allah is ever Forgiving and Merciful.
Moving for the sake of one's faith is rewarded.
Quran, Surah Al-Israa 17:34
وَلَا تَقْرَبُوا۟ مَالَ ٱلْيَتِيمِ إِلَّا بِٱلَّتِى هِىَ أَحْسَنُ حَتَّىٰ يَبْلُغَ أَشُدَّهُۥ ۚ وَأَوْفُوا۟ بِٱلْعَهْدِ ۖ إِنَّ ٱلْعَهْدَ كَانَ مَسْـُٔولًۭا ﴿٣٤﴾
And do not approach the property of an orphan, except in the way that is best, until he reaches maturity. And fulfill [every] commitment. Indeed, the commitment is ever [that about which one will be] questioned.
Muslims living under a country's laws must keep their agreements.
Where the ruling is recorded
- Buhuth fi Qadaya Fiqhiyya Mu'asira (Mufti Taqi Usmani), The paper on residing in non-Muslim countries. Divides residence by purpose: forced, for da'wah, for livelihood, and for luxury, with a ruling for each.
- al-Mughni (Ibn Qudama), Kitab al-Jihad, the section on hijrah. Hijrah is obligatory on one unable to practise religion openly and recommended for one who can.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.