Oedipus Rex takes place in the city-state of Thebes, Greece. While Oedipus Rex was purportedly written circa 429 BCE, scholars are now uncertain of the exact date it was performed and also the time period during which it supposedly takes place. Regardless, the entire play takes place in front of the royal palace of Thebes.
There are a few reasons for Oedipus Rex's specific and unchanging setting. Considering the play was written to be performed at a festival in Athens in ancient Greece, a static setting was an understandable choice, and many Greek tragedies have only one setting for the same reason. The title of the play—Oedipus Rex, or Oedipus the King—further justifies the setting of the steps of the royal palace. The setting and play alike both center around the protagonist, Oedipus, and the circumstances of his rise to power. Indeed, the setting is the very place where Oedipus supplanted his father, both in becoming king and in wedding his mother Jocasta. At the same time, the play concludes with Oedipus entering the royal palace as a blind man, no longer king of Thebes. The steps of the royal palace are then a physical manifestation of the prophecy that haunts Oedipus, and the events of the play occur in the shadow of the prophecy.