Regulator placement

I am wondering where my regulator/filter should go. Should it come directly off the compressor, or should I install a flexible airline from the compressor to the regulator/filter? Then attach it to the wall?