The correct location of suricata-IDS

Hello,
To protect a website from attacks, I want to use Suricata. Can I install Suricata-IDS on the same web server or should I install it on another server and put the web server behind Suricata-IDS?

Thank you.