Choose the location for the hammock, making sure that you have enough space for it. The spacing of the posts depends on what type of hammock you have. If it has a spreader bar, the hammock needs to be pulled taut when it is installed, but if it has no spreader bar, the hammock is supposed to sag in the middle. Follow the manufacturer's instructions regarding the spacing of the posts.
Dig 2-foot deep holes in the ground where you're installing the posts with a post hole digger.
Add 4 inches of gravel to the holes and tamp it down with the end of a 2-by-4 board.
Mix a batch of cement, following the manufacturer's instructions, and fill one of the holes about halfway with the cement.
Place a 4-by-4 post into the hole, pressing it down to the gravel base. Check the post for level (horizontally straight) and plumb (vertically straight), and fill the rest of the hole with cement. Check the post for plumb and level again.
Set the other hammock post into the ground, following the same process. Allow the cement to set for the time specified by the manufacturer.