In the TV show, the Alexandria community was a planned community which the military had designated as a safe-zone and told people to wait in. The expectation was that help and reinforcements would arrive later, but they never did.
Deanna's husband was an architect who helped design and plan the walls. Precisely when this happened is unclear. We don't know exactly when the community was started, but being that the military was still functioning, involved and thinking (or at least promising) that there would be reinforcements to send, it would stand to reason that it was in the very early days of the outbreak.
In the comics, the community was started by a man named Davidson. In this version, he was the one who began construction on the walls. Davidson was later forced to leave the safe-zone.