Drill pilot holes through the back of the door section that will be attached to the doorjamb. From inside the closet, fasten the door to the doorjamb. Line up the molding with the track and attach the top screw. Allow the molding to hang naturally so that it lines up with the door, mark the screw holes and then attach it to the doorjamb. The catch will hold the door closed.
Accordion doors require minimal maintenance.
Just grease the bearings once every two years and clean the surface of the door the same way you clean your wood furniture. Using the Correct Romex.