In this study a cationic surfactant, cetyltrimethylammonium bromide (CTAB), was used as a soft template for in situ chemical polymerization of aniline on the surface of microcrystalline cellulose (MCC). The morphology of the wire-like and porous nanostructure of the resulting composite was highly dependent on the MCC and CTAB concentrations. The effect of the MCC and CTAB concentrations on the electrochemical and morphological properties of the polyaniline (PAni) nanocomposite was studied. Cyclic voltammograms of modified PAni/MCC/CTAB electrode displayed a high current response and the effect of scan rate on the current response confirmed a diffusion controlled process on the surface of the electrode that makes it suitable for sensor applications. The overlapping characteristic peaks of pure PAni and MCC caused peak broadening at 3263 cm-1 in the IR spectra of PAni/MCC/CTAB nanocomposite that revealed the interaction between NH of PAni and OH group of MCC via electrostatic interactions. The addition of MCC to PAni through chemical polymerization decreased the thermal stability of composite compared to pure PAni. Lower crystallinity was observed in the XRD diffractogram, with 2 theta values of 22.8, 16.5, and 34.6 for PAni/MCC, confirming the formation of PAni on the MCC surface.