The premise of the question contains a geographic error. Ancient Egypt's major cities, temples, and monuments were concentrated along the Nile River—from the First Cataract at Aswan northward through the Nile Valley—and within the Nile Delta itself, not outside it.
Herodotus called Egypt "the gift of the Nile." The river's predictable annual flood deposited fertile silt on a narrow floodplain (averaging 10–20 km wide) flanked by desert. Virtually all settlement, agriculture, and monumental building clung to this ribbon.
The Delta's branching distributaries (up to seven in antiquity) created a vast, fertile triangle—Egypt's breadbasket. Cities here controlled Mediterranean trade, military routes to the Levant, and agricultural surplus. Memphis, at the Delta's apex, was the strategic capital for much of Pharaonic history.
The famous "desert" sites—Giza, Saqqara, Dahshur, Valley of the Kings—are necropolises (cities of the dead) deliberately placed on the desert edge (the "Red Land") west of the cultivation line. They are not "cities" in the living sense.
Ancient Egypt was a linear civilization straddling the Nile, with its heart in the Valley and its broad base in the Delta. The desert framed it; the river defined it.