First, at the time of revelation, Prophet Muhammad (P.B.U.H) has instructed the people who were educated to write down the verses. They wrote it on different objects like leather, bone fragment and leaves.
In the second stage of a compilation of the Quran at the caliphate of Abu Bakar (R.A), Zayed Ibn Thabit with the committee of 4 people collected all the written pieces of verses and compiled it in the first authentic copy.