It is often said on online forums that you can just pitch your tent on the beach in Essaouira. I hate to speak ill of what is a very friendly, pleasant city, but the fact is that some pretty unsavoury characters sometimes walk the beach at night. You're better off camping in the thick bushes and trees a few hundred meters behind the beach.
A very chilled out beach town in the south. The medina is small, but cleaner (only slightly) and quieter than what you find everywhere else.