The ternary system of dodecylpyridinium bromide (DDPB)/acetone/H2O with appropriate composition can form a gel spontaneously and the gel is stable in hydrophobic ionic liquid 1-butyl-3-methylimidazolium hexafluorophosphate ([Bmim]PF6). Based on the gelation phenomenon we observed, the low molecular weight gelator (LMWG) was first tried to immobilize horseradish peroxidase (HRP) on glassy carbon electrode (GCE). The scanning electron microscope (SEM) images, the UV-Vis spectra and the bioactivity measurement indicate that the gel is suitable for the immobilization of HRP. The direct electrochemistry of the HRP-gel modified GCE (HRP-gel/GCE) in [Bmim]PF6 shows a pair of well-defined and quasi-reversible redox peaks with the heterogeneous electron transfer rate constant (ks) being 14.4 s−1, indicating that the direct electron transfer between HRP and GCE is fast. The HRP-gel/GCE is stable and reproducible. Also the electrode exhibits good electrocatalytic effect on the reduction of trichloroacetic acid (TCA), showing good promise in bioelectrocatalysis.