Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A glimmering crescent moon in Thursday's twilight sky, signaled to many of the world's nearly 2 billion Muslims that the holy month of Ramadan had begun. For one month, Muslims from Boston to Baghdad will forgo food, water and sexual relations from dawn to dusk.

The first fasting day of Ramadan will begin for many Muslims on Friday, and some on Saturday due to differences in moon sightings, and is an annual anchor in the Islamic calendar — a time when worshipers increase their prayers and acts of charity. They commune joyfully with family and friends at sunset, when they break the fast at tables laden with spicy dishes and sweet mint tea.

Not this year.

In the face of the global coronavirus pandemic, Muslims are preparing for an isolated and solitary Ramadan, with millions cooped up at home under social lockdown and mosques shuttered.

"You immediately notice the difference," said William Suhaib Webb, a U.S. Islamic scholar and Muslim convert, who said many of his fellow Muslims were missing the sense of community that accompanies the month.

Still, this is not unprecedented in the religion's 1,400-year history.

"The bubonic plague rocked the Muslim world for a long time," Webb said. "This is not our first rodeo with quarantine."

Webb, who has a large social media following and offers online religious education classes, has seen a vast increase in the number of people tuning in and preparing for a digital Ramadan.

"People are looking for community and a semblance of worship through online spaces," he said.

Since social restrictions began in the U.S., Webb has officiated a Muslim wedding online, witnessed nine testimonies from new converts over the platform Zoom and advised frequently on funeral rites. His online classes for those stuck at home have attracted 3,000 weekly pupils, aged 13 to 18, from places like New York, Russia, Senegal and Puerto Rico.

"They're finding this really beautiful expression through online community," he said, while conceding that often "Netflix wins" in the battle for online attention.

Although digital programs are not ideal as "nothing can replace people," he said, as with the adherents of other faiths, Muslims were showing resilience in the face of a global pandemic that has killed over 47,000 people in the U.S. as of Thursday, according to an NBC News count.

Islam remains the fastest-growing religion in the U.S., with about 3.45 million Muslims in the country as of 2018, according to the Pew Research Center.

Muslims will face the same restrictions because of the coronavirus as other faiths, said Ibrahim Hooper, spokesman for the Council on American-Islamic Relations (CAIR), a U.S.-based Muslim civil rights organization.

"It’s going to be a completely different Ramadan," Hooper told NBC News. "The basis of Ramadan is to understand what other people go through when they’re deprived of things in life, and so it’s an additional lesson."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Hooper said despite the outward changes, he hoped the month would still have the same spiritual feel and urged Americans to comply with national legislation and health guidelines to stay safe.

“Spiritual practices are always a help during times of crisis, fear and upheaval, so Islam like any faith can comfort its practitioners during these times.”

President Donald Trump last week retweeted a social media post by the conservative author Paul Sperry that questioned whether authorities would enforce social distancing rules in mosques as they had done in churches over Easter.

“I’ve seen a great disparity in this country," Trump told reporters on Sunday, referring to the posts. “I am somebody that believes in faith and it matters not what your faith is, but our politicians seem to treat different faiths very differently.”

The comments were condemned as "Islamophobic" and "divisive" by Hooper and other U.S. Muslims who said they needed to be challenged.

A few Muslim worshippers circumambulate a near-empty Kaaba in Mecca's Grand Mosque. AFP - Getty Images file

Elsewhere across the globe, in Saudi Arabia, the birthplace of Islam, public prayers at the two holy mosques in Mecca and Medina will be suspended to stem the spread of the virus, Saudi officials said Tuesday.

Millions of Muslims will tune in to watch the imam lead a shortened prayer on television but with no congregation behind him, as authorities emphasize the safety of bodies over souls.

A 24-hour curfew remains indefinitely in place in many of the Kingdom's larger cities, with residents supposed to leave their homes only for essential needs.

Nearby in the Gulf, religious authorities in the United Arab Emirates have said medical workers treating COVID-19 patients over Ramadan are exempt from fasting and urged all Muslims not to congregate during the month.

Jerusalem, home of the Abrahamic faiths, saw muted Passover celebrations this month as Jewish families stayed home. Easter also saw a near-empty Church of the Holy Sepulchre, with small groups of clergy wearing face masks in the wake of the virus outbreak.

The sacred city's al-Aqsa mosque compound and adjoining Dome of the Rock mosque will also both be closed to worshippers throughout Ramadan, authorities said this week.

The site typically draws hundreds of thousands of Muslims throughout the month for evening prayers known as Tarawih, where reciters strive to complete the whole Quran over 30 nights.

The labyrinth of narrow alleyways leading to the al-Aqsa mosque are normally decorated with bright lanterns and dotted with street vendors selling prayer beads, sights the mosque’s imam said he would dearly miss this year.

"We are pained and saddened by the decision to suspend prayers at Al-Aqsa mosque, but according to the Islamic law, we have to preserve the human life," Omar Kiswani told NBC News.

"We don't want the gatherings during the prayers to be the reason for this pandemic to spread."

A Palestinian craftsman in Gaza fashions a traditional "fanous" lantern, a decoration used to celebrate the start of Ramadan. Said Khatib / AFP - Getty Images

In Shia-majority Iran, which has been a hot spot for coronavirus cases in the Middle East, the country's supreme leader, Ayatollah Ali Khamenei, has called on Iranians to create the sense of Ramadan in their homes this year.

Iran allowed some businesses in the capital, Tehran, to reopen this month as the country's death toll lowered, but public gatherings remain largely banned. The country was criticized at the onset of the outbreak for keeping open religious shrines in the city of Qom, in the northwest, which may have helped spread the disease.

In Egypt a curfew from 9 p.m. to 6 a.m. will likely remain in place during Ramadan. The "Mercy Tables" and "Ramadan Tents," common features in front of mosques offering free meals to the needy, will be repackaged and delivered as parcels, the Ministry of Interior said.

Closing mosques has proved a divisive issue in the country of about 100 million people, with a spokesman for the religious Endowments Ministry being fired after he appeared on a popular talk show Sunday night and suggested night prayers should still go ahead. Religious authorities in Egypt have also warned against clandestine rooftop prayers in homes, to prevent the spread of the virus.

However, in Pakistan, where the government has come under pressure from religious groups, some congregational prayers will go ahead albeit with restrictions.

Worshippers will need to wear masks in the mosque and maintain a 6-foot (2-meter) distance from each other instead of the usual Muslim practice of praying shoulder-to-shoulder. Mosque administrations must remove carpets and regularly disinfect premises.

After the month-long fast, Muslims will come together to celebrate Eid-al-Fitr, normally marked by gifts, bright clothes and henna-stained hands.

In Indonesia, the world’s biggest Muslim-majority country, President Joko Widodo has already said he will ban the annual exodus of people streaming out of cities to home villages to celebrate Eid. The southeast Asian nation must continue to curb the spread of coronavirus, Widodo said.

For now, many Muslims preparing for an unusual Ramadan remain upbeat.

In London, mosques are streaming prayers online and setting up home-deliveries of dates, while public officials and social media influencers are urging people to stay home.

The message this Ramadan is simple: fast and pray at home and share Ramadan digitally. This is the way to worship Allah and help save lives. #StayHomeSaveLives #RamadanAtHome pic.twitter.com/o3YcTtZ4O1 — MCB (@MuslimCouncil) April 22, 2020

A student, Aminah Otmani, told NBC News that, despite the lockdown, she was "really looking forward" to the holy month.

“This is going to force us to be organized," said Otmani, 32. She will end the 15-hour daily fasts by cooking Moroccan and English dishes with her mother and taking walks to wave to her nearby siblings from the street.

Otmani's family will clear a spare room creating a make-shift "mini-mosque" she said, with her father leading communal prayers in Arabic.

Her actions strike a resilient note amid a global pandemic and echo the sentiments of Kiswani, the imam of Jerusalem's al-Aqsa: "The mosque’s doors are closed, but heaven's doors are not."

Reuters contributed to this report.