A pocket door is the perfect solution for closing off an open section of your home or office or adding a quick way to move from room to room where a wall currently exists. These doors disappear into the wall when opened, rather than taking up space in one room or the other. With the right tools and know-how, you can install pocket doors yourself, avoid the hassle of hiring a contractor, and take a hand in the design of your own home.
Step1：Making Space for Your Pocket Door
Purchase a pocket door kit at a hardware store. This kit should contain the door, split studs that allow the door to retract into the wall, a track on which the door runs into the wall, and door hardware. Most are under $100.
You may be able to find pocket doors at lumberyards, too. Regardless of where you go, you should easily find kits for doors that are 1 1/8 inches to 1 3/4 inches thick by 6 feet (1.8 m) 8 inches high. If your door is not a standard size, talk to a professional about getting the job done
Check the wall. The last thing you want to do is to tear a hole into your wall only to find that it's not feasible to put a door there. Before you go about drilling and tearing down, check for the following things: 
Check if there's enough room in the wall. You need just over twice the width of the door (so it can hide).
Check if the wall is load-bearing or just a partition. If it is load bearing, you'll need a new header and a means of temporary support while the door is being worked on.
Check for wiring or plumbing. A wall with pipes in it is not a good place to put a door. Wiring can be easily detected with a cheap voltage sensor.
Remove the existing door, if applicable. If you're replacing a door with a pocket door, you'll need to get rid of the existing door. Start with removing the molding and, with a reciprocating saw blade, cut the shims. When the nails are cut, you can remove the door frame. 
Door jambs aren't nailed against the studs in the wall – they're just spaced with wooden shims.
Remove the drywall on one side of the wall. Do this slowly to make sure you haven't missed any obstacles within the wall.  Remove the drywall a few inches above where the header will be, but don't go all the way to the ceiling – that just means more work later.
Cut the exposed studs carefully. This makes room for the new framing. You may find this step easier if you use a combination of a circular saw and a small hand saw; you do not want to accidentally damage the wall you did not cut away. The goal is to leave large enough holes in the studs to allow the pocket door to pass through.
A standard pocket door is 1.75 inches (4.4 cm) wide. To make this step even easier, look for a pocket door kit that comes with split studs.
Assembling the Door and Hardware
Make a new header, if necessary. It's possible that your door will require a header of a different height.  The height of your header is determined by whether or not you need a new soleplate. If the floor covering above the subfloor is minimal, the split-stud brackets can be secured directly to the floor. To determine the header height for most standard kits, figure the length of the new door, plus 3 1/4" and the height of the soleplate, if any. Once the appropriate length is determined, install a new stud this length from the existing stud on the opposing side. Nail the new header in place (or screw) and then cut and fit the soleplate to the floor.
To adjust the header, use a reciprocating saw to remove the partition header currently in place. Then, cut away the studs, just like in the above, to make space for the framing.
Cut the nails that are between the studs and the soleplate and then determine the height of your desired header before cutting the stud tops to length. Otherwise, you may end up with a frame that is not to size.
Install the slider track. Your pocket door kit should contain the rails on which the door slides into the wall. Install the slider track using the directions that come with your pocket door kit, screwing the brackets into the studs. If you are also installing pre-split studs, you can install them after you install the slider track. 
If you need to cut the track to length, use the mark on it that corresponds to your door size. Most, if not all, kits come with these markers. Use a hacksaw on the channel and a handsaw on the nailers.
Make sure your track is level. If it's not, it won't slide easily in and out of its pocket.
Place the hardware and the door into the slider track. Make sure that the door is sliding easily and stays level. Mount hangers on the top of the door – this is how the door will slide. Then, slide the wheeled carriages into the track. Hook the hangers onto the carriages. Once it's all set, adjust the assembly until the door hangs plumb and is in place.
Finishing the Project
Replace the drywall you removed at the beginning of the project with new drywall. For this part, you'll need panel adhesive and screws. However, don't move onto taping and mudding just yet – there's still a bit more work to be done. 
Install the latch hardware. The pocket door kit should have come with door latch hardware. Some of this will be attached to the door and some will be attached to the wall. Follow the instructions that came with the pocket door kit. Make sure the door is still sliding easily on the track and that the latches line up as needed.
Finish installing the drywall. At this point, you can tape and mud the drywall. Apply plenty of drywall compound, aiming for multiple coats over every seam. Embed tape in it, then get rid of any excess compound. Allow it to dry, sand it, then apply the next layers of compound using the same method as necessary.
When you are finished, sand the drywall to make it finished and smooth.
Paint or otherwise decorate the wall as you see fit. The hard part is done – all you have to do now is return the wall to its original (or new and improved) state.
Do this before you install the door trim, unless you want the door trim painted, too. This way if your lines aren't perfectly straight, the trim will cover them right up.
Install the door trim. The trim hardware should have come in your pocket door kit. Install it according to the pocket door kit instructions. Nail or screw it to the jamb and the door studs. 
That's it! Your pocket door is officially ready for use and looks like it was installed professionally.