You need at least 16 1/4" by 19 7/8". :)
Seriously the bees will forage the 8,000 acres around you. If you put the hive facing the wall of your house the guard bees will not see people walking by and the field bees tend to go up. A 6' fence is nice, but probably not necessary unless you have it closer to the property line and/or facing the property line.
I've had bees in town most of the last 41 years with no issues.