Position the bi-fold doors within the doorway opening and determine if the doors will fit easily. Modify the size of the opening, if necessary, by either cutting the opening to fit the doors or adding wood blocks around the opening to make it smaller. Screw the wood blocks directly into the frame.
Mount the rail for the bi-fold doors at the top of the opening. Mark the position of each attachment screw hole. Pull the rail out of the opening and drill out each hole with a wood drill bit that is slightly smaller in diameter than the wood screws. Spread caulking over the top of the rail. Replace the rail and attach it in place with 3-inch wood screws.
Repeat the installation process to add the bottom rail and try to keep both rails exactly parallel.
Set the bottom of the bi-fold door in place within the bottom rail. Compress the pins of the door that extend up from the top of the door and maneuver them into place within the top rail. Open the door and make sure the opening and closing are smooth. Make any necessary adjustments. Repeat to attach the other door.