In this paper the possibility of obtaining the intentionally undoped high resistance GaN buffer layers in AlGaN/GaN heterostructures with high electron mobility for transistors by ammonia molecular beam epitaxy was demonstrated. The growth conditions based on background impurity concentrations and point defects calculations for different gallium and ammonia flows ratios were optimized.