Frame your rough opening as you would for an ordinary door, making it an inch or two wider than the complete pocket frame. Install trimmer studs and a header across the entire opening. If you’re cutting into an existing wall, take the standard precautions, determining if the wall is load-bearing and bracing as necessary during construction.
Modern pocket doors are generally attached to a wheel or wheel system which rolls along a track attached to the header. The door itself has an adjustable support at either edge of the top of the door. This hooks into the wheel assembly, and allows you to adjust both the height and the plumb of the door.
A rubber bumper attached to the trimmer stud inside the wall stops the door from banging loudly when it opens.
Install the door and test it before covering the wall in drywall, and once you’ve drywalled, trim the exposed trimmer stud with jamb stock and the openings into the walls and head jambs with narrower trim stock.
Trim the opening with casing.
For a nice touch, install a recessed door pull in the edge of the door which you see when it’s open. At the push of a button or lever, a small handle pops out, allowing you to pull the door open.
If you’re installing double doors, nail a half inch strip of 1/4″ material to one door, and use a router to cut a corresponding groove in the other door. This ensures that when the doors are closed, there’s no gap between the two.