Everything about how a door hangs depends on the lining. A lining that is out of plumb, twisted or out of square cannot be corrected by adjusting the door.
Lining or frame
A lining is the flat timber surround inside an internal opening, with a separate planted stop.
A frame is a heavier section with the stop machined in, used for external doors.
Linings come in standard widths to suit wall thicknesses, commonly matching a 100mm stud wall with plasterboard both sides.
Measure the wall thickness including the plaster and buy a lining to suit, or plane it down.
Sizing it
The internal dimensions of the lining set the door size.
Assemble the lining so the internal width equals the door width plus the clearance, around 5 to 6mm total for a 2 to 3mm gap each side.
The internal height should be the door height plus the top clearance plus the bottom clearance.
Assemble the lining before fitting it, on a flat surface, and check it is square by measuring the diagonals.
Most linings have a housing joint at the head. Glue and screw or nail it.
Fit a temporary batten across the bottom to hold the width while it is being fitted, and remove it afterwards.
Fitting it into the opening
Stand the lining in the opening and hold it with wedges or clamps.
Plumb the hinge side first, in both planes, using a long spirit level. This is the reference for everything.
Check it is not twisted by sighting through, or by winding sticks, or by checking that both edges are plumb.
Check the head is level.
Then set the latch side parallel to the hinge side, checking the width at top, middle and bottom.
Measure the diagonals again to confirm it is square.
Packing
The opening is never a perfect fit, so the lining is packed to hold it true.
Pack behind every fixing point, using plastic packers or timber offcuts.
Without packing, tightening the screws pulls the lining into the shape of the opening.
Pack at the hinge positions particularly, since that is where the load is.
Keep the packers in place permanently rather than removing them.
Fixing
Timber stud opening: screw or nail through the lining into the studs, at around 400 to 500mm intervals, and at every hinge position.
Masonry opening: use frame fixings or plugs and screws, or fix to timber battens plugged into the masonry.
Countersink and fill, or use lost-head nails punched below the surface.
Do not rely on expanding foam alone to hold a lining, though foam is useful for filling the gap afterwards and adding rigidity.
Check the lining is still plumb and square after fixing, since tightening moves things.
Fitting the stop
The stop is fitted after the door is hung, not before.
Hang the door, close it to the position you want, and pin the stop against it with a business card or a thin packer as a clearance.
Fix the head stop first, then the sides.
Fitting the stop first means the door has to be forced to fit whatever position the stop happens to be in.
Making good
Fill the gap between the lining and the wall with expanding foam or packing, trimmed flush.
Plaster or fill up to the lining, or cover the junction with architrave.
Architrave is normally set back from the lining edge by a consistent margin of 5 to 10mm, which gives a shadow line and hides small irregularities.
Common problems
A lining fixed without packing, which bows and makes the door bind in the middle.
A twisted lining, which means the door touches the stop at one corner and gaps at another.
A lining plumbed on the wrong reference, so the door hangs open or closed.
Replacing a lining in an old house
Openings in older houses are frequently well out of square, and the existing plaster is finished up to the old lining.
Expect to make good the plaster around the new lining, and allow for architrave wide enough to cover the disturbed area.
Check for cables and pipes in the wall beside the opening before fixing.
Fire door frames
A fire door needs a certified frame with the correct stop depth and intumescent seals.
An ordinary lining will not do, and the assembly is certified as a whole.