Cellulose nanocrystals were extracted from cellulose raw material through hydrothermal process, and then polyaniline layer was coated on the surface of cellulose nanocrystals via in-situ chemical oxidative polymerization of aniline monomers. The resulting nanocomposite was investigated by scanning electron microscopy, Fourier transform infrared spectrometry, thermal gravimetric analysis, and gas sensing measurement. The results show the nanocomposite with good core-shell structure exhibited high thermal stability. For ammonia gas detection, high sensitivity, relative fast response, short recovery time, and good reproducibility can be achieved for the nanocomposite.