A door that sticks, swings open on its own, or shows uneven gaps around the edges almost always traces back to a poorly installed frame. The frame is the foundation, and getting it plumb, level, and square determines whether the door operates smoothly for decades or frustrates you every time you close it. Knowing how to install a door frame correctly is one of the most practical carpentry skills a homeowner can learn, and the job requires no specialized tools beyond what most DIYers already own.
Part of our Windows & Doors guide — explore the full guide →
Understanding Door Frame Components
A standard door frame (also called a door jamb assembly) has three main pieces: two side jambs and one head jamb across the top. The side jambs run vertically from the floor to the head jamb, and the head jamb spans horizontally between them. Together they create the rectangular opening the door sits in.
Pre-hung door units come with the frame already assembled and the door hinged in place. If you are buying a pre-hung unit ($100-$400 for interior, $300-$1,500 for exterior), half the work is already done. If you are building a frame from scratch to fit an existing door, you will need jamb stock lumber (typically 3/4-inch thick pine or poplar milled to match your wall thickness) and a door stop molding strip.
Measuring the Rough Opening
The rough opening is the framed hole in the wall where the door frame sits. Standard rough openings are 2 inches wider and 2-1/2 inches taller than the door slab. A 36 x 80-inch door needs a rough opening of approximately 38 x 82-1/2 inches. This extra space provides room for the frame material, shims, and adjustments.
Measure the rough opening width at the top, middle, and bottom. Measure the height on both sides. Write down all six measurements. If the width varies by more than 1/4 inch across those three points, the framing is out of plumb and you will rely heavily on shims to compensate. If the measurements vary by more than 1/2 inch, consider correcting the rough framing before installing the door frame.
Also check the floor for level across the opening. An unlevel floor means one side jamb needs to be trimmed shorter than the other so the head jamb ends up level. Skip this check and the door will hang crooked no matter how carefully you shim.
Setting the Frame in the Rough Opening
Place the assembled frame (or pre-hung unit) into the rough opening. For pre-hung doors, slide the entire unit in from the hallway side with the door closed. Center it in the opening with roughly equal gaps on each side.
Start with the hinge side. This jamb must be perfectly plumb (vertically straight) because the hinges reference it for every swing of the door. Hold a 4-foot level against the hinge-side jamb and check for plumb. Insert shims between the jamb and the rough framing at three points: behind the top hinge, behind the bottom hinge, and midway between them.
Tap shims from both sides (use pairs of tapered shims opposing each other) until the jamb reads plumb on the level. Do not over-shim or you will bow the jamb inward. The gap between the jamb and the closed door should be a consistent 1/8 inch from top to bottom.
Shimming and Fastening
With the hinge-side jamb plumb and shimmed, drive 2-1/2 inch or 3-inch finishing nails or trim screws through the jamb and shims into the rough framing. Place fasteners at each shim point. For pre-hung doors, remove the center hinge screw from the top hinge and replace it with a 3-inch screw that reaches through the jamb and shims into the wall stud. This single screw carries most of the door’s weight and prevents the frame from sagging over time.
Move to the strike side (latch side). Close the door and check the gap between the door edge and the strike-side jamb. Shim behind the strike plate location first, ensuring a consistent 1/8-inch gap. Then shim at the top and bottom of the strike jamb. Check that the head jamb is level before fastening the strike side.
Open and close the door several times during this process. Watch the gap around all four edges. It should remain uniform. If the gap tightens or widens as you add shims, you have introduced a bow in the jamb. Back off the shims and readjust.
Installing the Head Jamb and Checking for Square
The head jamb should sit level and tight against the tops of both side jambs. Shim above the head jamb at two points, roughly 6 inches from each end. Check level, then fasten through the shims into the header framing above.
Verify the frame is square by measuring diagonally from corner to corner. Both diagonal measurements should be equal within 1/8 inch. If they differ by more, the frame is racked (parallelogram-shaped rather than rectangular). Adjust the shims on the side jambs until the diagonals match. A racked frame causes the door to bind at the top or bottom corner.
Trimming Shims and Adding Door Stop
Score each protruding shim with a utility knife along the edge of the jamb and snap it off flush. Do not saw shims off since the vibration can shift the jamb slightly. A clean score-and-snap leaves a flat surface for the casing trim to sit against.
If you built the frame from jamb stock (not a pre-hung unit), nail the door stop molding to the jambs now. Close the door and position the stop strip so it contacts the door face with light pressure. Nail it with 1-1/4 inch brad nails every 12 inches. Miter the stop pieces at the corners for a clean look, or use butt joints for a simpler approach.
Installing Casing Trim
Casing trim covers the gap between the door frame and the wall surface. Standard casing stock ranges from $1.00-$4.00 per linear foot depending on the profile. Colonial, ranch, and Craftsman profiles are the most common.
Reveal the edge of the jamb by about 3/16 inch (set the casing back from the jamb edge rather than flush). This small reveal creates a shadow line that hides any slight irregularities between the jamb and casing. Mark the reveal with a combination square set to 3/16 inch, running a pencil line along both side jambs and the head jamb.
Cut the side casings to length with a miter saw. If using mitered corners (45-degree cuts at the top), cut the head casing and side casings so the miters close tightly. If using butt joints with rosette corner blocks, cut everything square. Nail the casing to both the jamb edge and the wall framing with 2-inch finish nails or an 18-gauge brad nailer. Set the nails slightly below the surface and fill with matching wood putty.
Common Mistakes and How to Avoid Them
Rushing the shimming process causes most door frame problems. Take the extra 10 minutes to get the hinge jamb perfectly plumb before touching the strike side. Every fraction of an inch matters.
- Not using long screws in the top hinge: The factory screws are only 3/4 inch long and pull out under the door’s weight. That single 3-inch screw in the top hinge prevents years of sagging.
- Shimming too tight: Over-shimming bows the jamb inward, causing the door to bind. Shims should be snug, not forced. If you need a hammer to drive them, you have gone too far.
- Ignoring the floor: An unlevel floor throws off the entire installation. Check and compensate before setting the frame.
- Nailing without checking the door: Always close the door and check gaps before driving permanent fasteners. Once nails are set, adjustments require pulling them and starting over.
The total cost for a DIY door frame installation is modest: $20-$40 for shims, screws, and nails, plus $15-$60 for casing trim, plus the cost of the door itself. A carpenter charges $150-$350 for the same work, so the savings are real if you have the patience to get the shimming right.