So we install 1000’s of doors. We get pretty good at it. So for our clients that are out of town who have local contractors (and some do-it-yourselfers) here is the how to do it.
We supply a 1″x3″ board that is the same length as the track. We make this board at the time as the door so it matches. This board is critical! It is the supporting mechanism. It also provides a space out from the wall such that the door will clear your trim.
This board is SCREWED to the studs securely and then the door rail is attached to this board with lag bolts. No need to secure the door rail to the studs but rather it is secured to the 1×3. See pic below. This is a rustic door install but if a modern door the 1×3 would be painted wood.