how do you install a glass door on a drywall?
Gypsum board will not support a glass door, unless the door is tiny (like a 6" square).

You will need a frame which goes all around the opening and is secured to a structural member, like a stud. Then the door is attached with hinges to the frame and a latch or latches are installed on the other side of the frame.