A series of 1-(4-(2-allylphenoxy)butyl)piperidin-1-ium halides (4a-d) was synthesized and characterized via spectroscopic methods (FTIR, 1 H NMR). The corrosion inhibition of the synthesized halides on carbon steel in water-salt-hydrocarbon environment, saturated with H2 S, was investigated. For this purpose, a series of techniques such as gravimetric measurement, potentiodynamic polarisation, and scanning electron microscope (SEM) were used and some thermodynamic parameters of corrosion process (Δ
G
ads.
,
ΔH
0
ads.
, Δ
S
0
ads.
) were evaluated. The steel surface was checked by SEM, and the steel surface showed good surface coverage. The results showed that the synthesized compounds at the concentrations 125, 150 mg ×L
-1
have corrosion inhibition activity of 78%–95% by gravimetric measurements and 81%–92% by potentiodynamic measurements at 100, 150 mg ×L
-1
. The biological activity was examined against sulphate-reducing bacteria (SRB). It was revealed that at the concentration of compounds 4c and 4d, 100 mg ×L
-1
, the antibacterial activity was 100%.