Before you install the door you need to perform other works.
At what stage of repair interior doors are installed : Before You Install The Door You Need To Perform Other Works.
Quote from Article entitled At what stage of repair interior doors are installed:
During installation, you must take into account whether there carpets will be on a floor on the entire circumference of opening. If it is so, then you need to take into account their thickness and increase the gap.
The full version of the article can be found here.