Specifically, he did not teach in public in the Athenian period of his life; neither in the agora, nor in the Gymnasia (of which the Academy and the Lyceum were two). The Gymnasia were governed by somewhat strict rules, as they were constructed and operated for the training and education of the next generation of male citizens--the very future of the city-state.
Before Epicurus began his brief tenure in Lampsacus (where he developed several lasting and important friendships), he was more or less driven out of Mytilene for his teachings. This must have been an education of a kind, but there was something else to keep him on guard when he got to Athens: the memory of the trial of Socrates, on the charges of impiety and corrupting the youth. Sure, that was a century before, and maybe things change. But a century and a half before that, the Athenians sentenced another man to death, a philosopher named Anaxagoras. His crime was also impiety; he was accused of materialism (true enough in his case, though not in Socrates'), and this first thinker to bring philosophy to Athens escaped death only by being exiled from her.
And yet, in the time of Socrates, Anaxagoras' books were circulating widely in Athens and could be had in the market for a drachma. Preposterous? Certainly! But that was the point; what was said in private, or merely committed to paper and circulated, was of little enough concern to the City's elite. A brazen tongue must occasionally be silenced; the idea that animated it was tolerated to persist.
In any case, Anaxagoras (who thought, among other things, that the sun and moon were made of rock) secured his safety by fleeing to, of all places, Lampsacus! Athens went on to become an emblem of free-thought, Lampsacus, to be forgotten. That is the way of things, I suppose.