You'll need a fresh install of Raspbian for this to work. Once you get it set up, type this command into the command line:
curl -sSL https://install.pi-hole.net | bash
The command pulls an automated bash script that installs all the necessary software and sets everything up. From there, just point your various devices to use the Raspberry Pi as a DNS server and you're good to go.
For more information see this instruction video
Happy blocking !