Just like always. Built a fortification and defend it.
In A16 it was a fight cage - 10 x 10 pillar 50 cage with a cap on top to stand and shoot on, with an iron bar overhang, surrounded by 3 rows of spikes. Some on top shooting, some of us inside bashing faces as their heads went through the bars.
Now that doesn't work because of the insane concentrated block damage, so we just build a fort. Ideally we take over the ranger station and completely fill the lower floor + porch with cobblestone. This time, we took over a house POI and made a 4-block thick wall all the way around the perimeter we wanted to protect (farming in the front yard.) Iron bar overhang, but this time we make it 1 out horizontally and 2 up vertically so that spiders can't jump up from the bailey.
Around either one, we put an outer wall that has a shooter platform in the center (3 x 3, tall as the wall with a 1 block walkway, iron bars) flanked by 2 1-deep 6 x 4 pits on either side. The outer wall is only 2 tall, because all it does is deny the zombies an easier ingress. There are pits also at the corners of the wall. The pits get filled with spikes. We put 3 rows of spikes and then a row of barbed wire around the inner wall. That's it.
The pits are the easiest ingress and when the zombies cross in, they take damage and die on the spikes. We also rain down molotovs while they're in there. And we shoot the hell out of them.
So far, the only breech we've had was on our first night when our inner wall was only 2 thick and then we just basically ran around on top of the wall shooting them in the face as we did.