Building a masjid in a
    place where it is not expected Muslims will remain permanently is permissible
Question

                Is it permissible to build a masjid, or
      convert a building to a masjid, in a place or town where it is expected that the Muslims
      will leave after some time? Considering that in America, Muslim students may establish a
      masjid in a particular place, then graduate and return to their home countries, resulting
      in the masjid being left abandoned or almost abandoned.
Praise be to Allah.All praises are due to Allaah. A masjid should be built or a building
    should be converted into a masjid due to the general benefit and good to the Muslims that
    are present, and considering that it manifests and makes prominent the rituals and rites
    of Islam. In addition, it raises and inspires hope that it will play a role in attracting
    many Muslims, and result in some of the people who live in the area accepting Islam.