We have used the diamond anvil cell technique to measure the hydrostatic pressure dependence of the optical absorption edge and photoluminescence peak energy of MBE grown InN, In-rich In 1-x Ga x N (0 < x < 0.5) and In 1-x Al x N (x = 0.25) alloys. Together with previous reports, our results show that the pressure coefficient of the absorption edge varies monotonically from about 3.0 ± 0.1 meV/kbar for InN to 4.2 meV/kbar in GaN and to 4.9 meV/kbar in AlN. The photoluminescence measurements yield significantly smaller pressure coefficients than the coefficients of the bandgap, which is attributed to emission associated with recombination via highly localized defect states. Samples which give small photoluminescence pressure coefficient usually have large Stokes shift. Based on the results of the absorption and photoluminescence measurements we are able to determine the absolute deformation potentials of the conduction and valence band edges of these alloys.