So in all realism, besides the natives and other American nationals moving West, were there Muslims moving out too? Too often, we hear about the Christian side of things and manifest destiny. But there had to have been Arabs, Indians, and other Asian communities, right?
Muslims traveled the Wild West for as long as it was "wild," but only in very small numbers.
The first Muslim in the American West was Mostafa al-Azemmouri, a Moroccan who was enslaved by the Spanish and became one of the four survivors of the ill-fated Narváez expedition in 1528. Azemmouri walked the entire American coast from Florida to New Mexico. He walked miles in front of the three Spanish survivors to blaze the trails they followed and ensure their safety, so he became the first non-Native to visit Pueblo lands in New Mexico, among other things.
In 1790, the U.S. Congress limited immigration to "free white persons". Muslim Africans were forcibly transported on slave ships in the 18th and 19th centuries, but generally had lost connection with their ancestral religion by the time of the "Wild West" period, so did not build mosques in the West. Middle Easterners were not generally thought to be white and so did not attempt to immigrate until large-scale settlement of the West had already begun. As their numbers grew, the Supreme Court ruled in Dow v. United States (1915) that Arab Christians were legally white, but that Arab Muslims were non-white. The Ottoman History Podcast has an episode detailing the story of a Syrian who was deported after this ruling. After this, Muslims were largely unable to enter the United States until racial discrimination was lifted in 1965.
From the 1890s until the 1915 ruling, a small number of Syrian and Lebanese Muslims did successfully immigrate and settled alongside Syrian Christians on the prairie, where they often worked as traveling salesmen. One vaguely "Oriental" peddler is famously portrayed in the musical Oklahoma!, which was based loosely on the reminisces of a real Oklahoma pioneer. It is unclear whether this fictional character is Christian or Muslim, but the real-life peddlers were both, as documented in William Sherman’s book Prairie Peddlers.
Other Muslims arrived by an unusual route. In 1904, St. Louis held a World's Fair and Olympics, which the organizers decided would be oriented around an "anthropological" exhibition. The main campus of the fair would import and display hundreds of "savage" and "semi-civilized" people living in exotic mock-ups of their "native habitats", in order to demonstrate the global nature of white supremacy (the 1904 Olympics also invited non-whites as part of this theme). Muslim Moros from the Philippines, then an American colony, were the largest Muslim community on display. Their fierce resistance to American imperialism had made them into Wild West-style indigenous heroes for some American consumers of pop culture, and at the fair, they were granted the privileged label of "semi-civilized." Some Moros asked for permission to stay in St. Louis after the fair but were seized by police and forcibly repatriated, according to Michael C. Hawkins's 2020 book Semi-Civilized: The Moro Village at the Louisiana Purchase Exposition.
The 1904 World's Fair also featured a 1:1 replica of the Old City of Jerusalem, complete with the Temple Mount. As far as I'm aware, then, the first mosque west of the Mississippi was the temporary mock-up of the Dome of the Rock built for the World's Fair. Arabs who were brought to populate this replica were allowed to stay in St. Louis after the fair ended, and their descendants are still there today. The first permanent mosque in the United States was built in 1924 in North Dakota by Syrian traveling sales families. I suppose this mosque appeared after the mythological "Wild West" period, although that was always a rather vague thing, e.g. the final American Indian War was the Posey War in 1923.
Some, but not all, of the ideas for this post came from the TV show The Great Muslim American Road Trip which aired on PBS yesterday. This show is kind of puffy but also interesting in places.
P.S.: The North Dakota Syrian/Lebanese community existed and prayed together since around 1900, but the first known collective practice of Islam in the United States that I'm aware of was in the household of Bilali Mohammed around 1800, on the island of Sapelo Island, GA.
Yes, there were a number of hot tamale vendors primarily of Afghani and Pakistani origin practicing Islam in the American West during the late 19th and early 20th centuries. There are even records of "hot tamale wars" breaking out between rival Afghan merchants, one of which resulted in a notorious 1909 murder in Washington state that the Seattle Star called “the vendetta of the hot tamale men”. Now Afghans hawking Mexican food in the Wild West might sound a bit odd but there's actually quite a bit written about such people. Especially one of the most interesting and prominent, Hot Tamale Louie aka the Muslim Tamale King of the Old West. In fact, why not go all the way back to the start of his story.
Born Zarif Khan in a village circa 1887 near the Kyber Pass along the modern Afghan-Pakistani border, our man left home at about age 20 for reasons unknown and traveled first to Seattle WA, then to Deadwood SD before ultimately settling in the mining town of Sheridan Wyoming in 1910. As a side note regarding your question, 1910 is a bit near the end of the "Wild West" period but a commonly used cutoff is when the last of the lower 48 territories became a state (1912) so I'm counting it.
Anyway, it was in Sheridan Wyoming that Zarif earned his nickname by buying a shop named Louie's then apparently deciding it was too good a name to change thus ensuring that people would call him "Louie' from that point on. The shop specialty was of course tamales which were made using chickens raised in Zarif's backyard and killed in halal fashion. By most accounts they were awesome but the hamburgers were also very popular possibly due to Zarif's special ingredient which was said to be heart, as in actual beef heart plus a little tongue. For years local residents would enjoy retelling stories about Louie's and Zarif to each other and reporters who stopped by. One such tale from the New Yorker magazine had Joe Medicine Crow, WWII hero and the last native American war chief of the Great Plains, missing his own hometown's celebration in his honor because he got caught up chowing down with Mr. Khan after insisting on stopping in Sheridan on his train ride back to Montana from the war. I couldn't find corroborating accounts of the Joe Medicine Crow stuff, but the primary sources basically all agree that Louie's was dope.
What did Zarif Khan do with all the cash he was earning? Well despite not knowing how to read or write he went and invested it in the stock market, becoming a fairly wealthy man. And while never building a place of Islamic worship in Sheridan WY, Zarif did start funding the construction of mosques and wells in modern day Pakistan before the stock market crash of 1929 put a pause on things. The crash more or less forced things back near square one financially but the restaurant was still there so Zarif just kept on slinging tamales and burgers with his trademark high pitched voice and remarkably fast pickle chopping skills all through the Great Depression. There are stories about Zarif giving out free meals to whoever needed it in Sheridan during those tough times and loaning out money to his customers which as you might expect, brought hum a good deal of acclaim. But maybe this a good time to stop and balance out the depiction of Zarif Khan because there were definitely unflattering aspects of his persona, particularly from a modern perspective. Zarif's marriage to his wife Bibi Fatima occurred when she was 15 years old for one. It was an arranged marriage for which Zarif travelled to Pakistan then returned to Sheridan with Fatima where she soon became pregnant. Following the birth of the couple's first child Roenna, Zarif would regularly refer to his wife as a disgrace for not delivering a son (other children including boys would follow). The hamburgers served at Louie's were also reported to occasionally contain questionable material such as horse meat and one time the tip of Zarif's finger. With that said, there's little question that Zarif Khan was a widely liked and respected member of the community as evidenced by several of Sheridan's town fathers standing witness for Zarif when he filed naturalization petition to the United States government, which ended up being approved.
But then bullshit ensued. After spending 20 years in the country and becoming a full naturalized American in 1926, Zarif Khan had his citizenship ripped away just 5 months later when a judge ruled that Afghans were excluded from America by law (Zarif self-identified as an Afghan despite being categorized as a Pakistani, Indian, Turk, Greek and Mongol at various points). See at the time the United States was experiencing one of its classic periodic surges in nativist/xenophobic sentiment and this one had a stark "Yellow Peril" flavor to it. That meant problems for any immigrant hailing from Asia who would often see their naturalization statuses challenged in courts by whitey thanks to several anti-Asian acts of Congress (I recommend reading White by Law by Ian Haney-López for more on the topic) combined with racist local opinions. And so the unfortunate reality of the early 20th century American West was that a naturalized U.S citizen born anywhere in Asia could wake up one day to a DA subpoena accusing them of being "white" but not "caucasian" or some such nonsense followed by a judge revoking their citizenship. Which is what happened to Zarif Khan in 1926 resulting in the laugh-so-you-don't-cry newspaper headline "'Hot Tamale Louie' Claims He's White in Citizenship Suit" in the August 15, 1926 edition of the Sheridan Post.
However Zarif Khan remained remarkably unfazed about getting caught up in this unhinged effort by nativist bigots to legalize hatred against the continent of Asia. And since he was still allowed to stay in the United States, Zarif just kept on serving customers at Louie's, raising his children, and investing money in the stock market again once it recovered. And the decades went by. Eventually he re-filed naturalization in 1954. This time the legal system had moved somewhat away from the semi-coherent racism of its past and Zarif finally got citizenship in the place he'd lived for 40+ years. It stayed permanent this time.
Zarif would go on to live to the age of 80, his death sadly came at the hands of his troubled grandnephew Sultan who stabbed Zarif during a dispute while Zarif visited the village in which grew up. But Zarif Khan had lived a full life, building a place for himself in a strange new land, fathering six children, and amassing an estate worth several million in today's dollars. Unfortunately Zarif's distrust regarding his money hurt his family after his death because his will didn't grant Fatima their estate, just a small monthly allowance. Which was pretty shitty thing to do on account that Fatima was a 26 year old illiterate, non-english speaker who got brought over from Pakistan at age 15 and now had to support six young kids on her own in Wyoming U.S.A thanks to Zarif croaking. But she persevered, learned English, brought several members of her family to Sheridan to help out, earned a drivers license, successfully sued for half Zarif's estate, joined the PTA, discovered basketball, and finally became an American citizen herself in 1970. Fatima ended up buying a local hotel and took the whole extended Khan family into the hospitality business. Today the family numbers almost two hundred in and around Wyoming, owns eleven hotels and established the first mosque in the state, Queresha Mosque in nearby Gillete (which unfortunately has dealt with a new surge of hate, this time anti-Islamic sentiment in the wake of 9/11). But overall the decedents of the Hot Tamale Louie are doing well. Two of his great grandsons won the Wyoming state wrestling championships in 2002 and 2003 respectively and I believe one of them is currently wide receiver coach at the University of Utah. Which is pretty cool. A jazz ensemble composition titled “Hot Tamale Louie” was also created based on Zarif's life which he may or may not have been into but his grandkids apparently enjoyed it.
If you've read this far and want to learn more I'd highly recommend Kathryn Schulz's excellent 2016 Pulitzer Prize winning piece on Zarif titled Citizen Khan (page 37 in first link below) which was a major source for this comment. Also White by Law: The Legal Construction of Race by Ian Haney López if you want to understand the truly bizarre racial categorizations the U.S. immigration system used back in the era.
Edit - kept calling him 'Zafir' instead of Zarif
The Khans of Wyoming: An interview with Kathryn Schulz
Various anecdotes about Zarif from Sheridan citizens
Afghan American Relations with Afghanistan, 1890-2016