Gas source molecular beam epitaxy with ammonia was used to grow AlxGa1-xN on Si(111). Three types of buffer layers, containing AlN, AlGaN/AlN, and AlGaN/GaN short period superlattices, were used and their effectiveness evaluated by x-ray diffraction. We determined that a combination of AlN buffer layer, prepared under the two-dimensional growth mode, with a short period superlattice of AlGaN/GaN results in the highest quality AlGaN. Under optimized growth conditions, x-ray diffraction coherence length almost equal to the layer thickness was obtained for low Al content layers. The normalized coherence length was reduced to ∼0.4 for x=0.66 and it increased again to ∼0.75 in AlN. From room temperature band edge cathodoluminescence of AlGaN grown on Si(111) we determined the alloy bowing coefficient of b=1.5 eV, in good agreement with previous results obtained by absorption measurements.