Search for the two studs in the wall where you want the head of the bed to be, using a stud finder. Mark the location of the studs. using the pencil.
Position the door by centering lengthwise against the wall so that it evenly overlaps the studs you've marked. Mark the positions of the studs' centers 3 inches from the edge on the back of the door.
Screw the D-ring hangers with fastening wood screws to the back of the door at the marked spots so that the top of the rings overlap the marks.
Subtract 3 inches from the height you want the top edge of the headboard (the side of the door) to reach and measure that distance up the wall studs. Mark those spots in pencil. Use a straight edge to draw a faint line connecting these marks.
Test the horizontal line with the level tool. Adjust the marks on the studs up or down, if necessary, to make the line level.
Screw the No. 8 screws at a slight upward angle into the wall studs at the marked spots. Leave half of the screw shank protruding from the wall.
Hang the door by looping the D-ring fasteners over the No. 8 screws. Move the bed into place in front of your new headboard.