Improving the coherence of superconducting qubits is a fundamental step towards the realization of fault-tolerant quantum computation. However, coherence times of quantum circuits made from conventional aluminum-based Josephson junctions are limited by the presence of microscopic two-level systems in the amorphous aluminum oxide tunnel barriers. Here, we have developed superconducting qubits based on NbN/AlN/NbN epitaxial Josephson junctions on silicon substrates which promise to overcome the drawbacks of qubits based on Al/AlOx/Al junctions. The all-nitride qubits have great advantages such as chemical stability against oxidation, resulting in fewer two-level fluctuators, feasibility for epitaxial tunnel barriers that reduce energy relaxation and dephasing, and a larger superconducting gap of ~5.2 meV for NbN, compared to ~0.3 meV for aluminum, which suppresses the excitation of quasiparticles. By replacing conventional MgO by a silicon substrate with a TiN buffer layer for epitaxial growth of nitride junctions, we demonstrate a qubit energy relaxation time {T}_{1}=16.3;{{upmu }}{{{{{rm{s}}}}}} and a spin-echo dephasing time {T}_{2}=21.5;{{upmu }}{{{{{rm{s}}}}}}. These significant improvements in quantum coherence are explained by the reduced dielectric loss compared to the previously reported {T}_{1}approx {T}_{2}approx 0.5;{{upmu }}{{{{{rm{s}}}}}} of NbN-based qubits on MgO substrates. These results are an important step towards constructing a new platform for superconducting quantum hardware.