Installation room doors need to remove trim, lay door on the floor, and fix the trim on the door with nails, and leave a gap in order to avoid friction door to frame.
Here you need to leave room for the door lock, given the small gap between the door and trim. Then remove the so-called box, and set it to the doorway in the correct vertical position.