Legend tells that Eleusis was founded by Eleusis, son of Ogygos of Thebes, before the 15th century BC. The town may have begun as a port town during Theban expansion. Regardless, remains from the Middle Helladic II period have been discovered, dating to the 18th-17th century BC.

Little is known about when and how the cult of Demeter was brought to Eleusis. The sources Apollodorus and the Parian Chronicle place the establishment of the cult in the 2nd half of the 15th century BC. It is not known from where the cult was imported, though Egypt, Thrace, Thessaly, and Crete have all been suggested. The "official" version of how Eleusis was founded is immortalized by Homer in the Hymn to Demeter. A man named Eumolpos, later killed in the Eleusinian wars against Athens, was reputed to be the first person initiated into the cult.

The exact details of the warfare between Athens and Eleusis are not known, but Athens prevailed in the end. By the time of Solon, Athens had a complete hold on Eleusis. However, the Eleusinians were allowed to retain control of the rites of Demeter. From this time forward, both the cult and sanctuary of Demeter flourished and grew. The cult became Pan-Hellenic and initiation was opened to non-Athenian Greeks.