Structurally speaking, electric fences are basically a regular wire fence with a battery and energizer attached. Start by installing posts (4 inches wide, if wooden) along the boundary of your property, roughly 49 to 64 feet apart.
The holes for each post should be about 3 feet deep. Home improvement stores sell tools called "post augers" specifically for digging these holes. Make the job go faster by renting a backhoe or skid steer loader equipped with an auger attachment. Otherwise, you can use a manual or motorized auger.
Ideally, each post should be perpendicular with the ground and stand just over 4 feet tall. If you want to make a gate anywhere along the fence, measure out the door's estimated length and install posts next to it on both sides.
Ties and Insulators
The posts at the ends of the fence and on either side of the gate(s) need to have wire ties installed. The number of ties you install depends on the number of rows you want your fence to have; four lines is ideal, but three is adequate.
The wire ties consist of 2 feet of 12.5-gauge high-tensile wire. At one end, the wire loops around the post once and is tied off with a "double half-hitch" knot. At the other end, the wire it tied to an "end strain insulator" with a double half-hitch. Space the four ties evenly up each post. Note: for a diagram, see the link in Resources.
Next, install four post insulators along each of the middle posts (i.e. not ends or gates) so they are parallel with the wire ties.
Thread a 12.5-gauge wire through each row of post insulators. Finally, tie the end of each threaded wire to the appropriate strain insulator on the end/gate posts, again using a double half-hitch. You should now have a completed wire fence consisting of three or four parallel, separate rails.
At each end/gate post, attach a vertical wire linking each rail to the one below it. Note: the strain insulator should be between the vertical wire and the post.
Next, attach a double-insulated wire (12- or 15-gauge) to the top rail wire, between the strain insulator and where the vertical wire touches. For gates, run the insulated wire down the side of the post and dig a 12-inch deep, narrow trench across the opening to the adjacent post. Lay the insulated wire along the bottom and attach it to the bottom rail of the adjacent post. Again, make sure that wire attaches between the bottom rail's strain insulator and the vertical wire. Bury the insulated wire in the trench.
At the end posts, attach insulated wiring using the same "top-rail-bottom-rail" pattern as with the rest of the posts. However, instead of joining the end posts with a single, buried insulated wire, attach a separate wire to each post. Connect the unattached end of bottom rail wire to the negative/black terminal of the energizer you purchased (see Resources for suggested models). Then, connect the unattached end of the other post's top rail wire to the positive/red terminal.
To electrify the fence, connect the energizer's voltage input terminals to a 12-volt "deep cycle" or "motive" rechargeable car battery and switch on the energizer.