The integration of aluminum gallium nitride (AlGaN) with silicon substrates attracts significant attention due to the superior UV sensitivity of AlGaN and the cost-effectiveness as well as mechanical robustness of silicon. A PIN ultraviolet photodetector with a peak detection wavelength of 274 nm is presented in this paper. By employing a SiN nucleation layer and a step-graded buffer, a high-quality AlGaN-based photodetector structure with a dislocation density of 2.4 × 109/cm2 is achieved. A double-temperature annealing technique is utilized to optimize the Ohmic contact of the n-type AlGaN. The fabricated UV photodetector attains a dark current of 0.12 nA at −1 V and a peak responsivity of 0.12 A/W.