A potentiostatic method has been employed to obtain silica layers on the surface of glassy carbon electrodes from a precursor sol–gel solution. The silica-modified electrodes were then used as a porous matrix for the electrochemical growth of conducting polyaniline. As a result, the overall synthesis of an organic–inorganic nanohybrid material has been achieved only by electrochemical methods. The growth of polyaniline is, in the first step, confined inside the silica matrix and appears to be controlled by the diffusion of aniline monomer units. Later, once the polyaniline fibers have reached enough length, emerge out of the template and the growth kinetics becomes comparable to that for polyaniline synthesized on a bare electrode. The silica matrix has a positive effect on the electrical capacitance of Pani since the polymer chains grow dispersed and the collapse between them is minimized.