The structural, electronic and vibrational properties of InN under pressures up to 20 GPa have been investigated using the pseudo-potential plane wave method (PP-PW). The generalized-gradient approximation (GGA) in the frame of density functional theory (DFT) approach has been adopted. It is found that the transition from wurtzite (B4) to rocksalt (B1) phase occurs at a pressure of approximately 12.7 GPa. In addition, a change from a direct to an indirect band gap is observed. The mechanism of these changes is discussed. The phonon frequencies and densities of states (DOS) are derived using the linear response approach and density functional perturbation theory (DFPT). The properties of phonons are described by the harmonic approximation method. Our results show that phonons play an important role in the mechanism of phase transition and in the instability of B4 (wurtzite) just before the pressure of transition. At zero pressure our data agree well with recently reported experimental results.