Consider using something like this instead of casting the posts right into the ground. This will keep them from rotting & allows for replacement later.

I'd cast footers, but I've been know to overkill every single project I undertake.

If you put the 4x4s right on the ground, make sure they're cedar, or pressure treated. However, ANY wood in direct contact with the ground WILL rot eventually.

Will