Measure the distance between the hinges on the gate. Mark corresponding spots on the fence post that you will hang the gate on. Make sure you mark spots high enough that the swing of the gate clears the ground across its entire course, which is a small, yet common problem on rolling farm terrain.
Drill holes into the posts at the points marked. Screw in the lag bolts using a pair of pliers or a wrench. Keep track of the number of turns you use to screw in the first bolt so you can install the second bolt to a matching depth, and check periodically with a level to ensure both bolts are installed straight. The top bolt should face down, and the bottom bolt should face up.
Maneuver the gate into a position so the bottom hinge is fitted into the corresponding lag bolt with the help of an assistant. Instruct your helper to hold the gate steady and level while you slide the top hinge up into its matching lag bolt and then tighten the bolts on both hinges, clamping the hinges into place.
Cut a length of chain with wire or bolt cutters. Wrap the chain around the end of the gate and secure it by closing the cut link in the chain with pliers. Drive a nail into the fence post. You can now secure the closed gate by wrapping the chain around the fence post and hanging it on the nail.