Updated date:

Build Your Own DIY Garden Fence

Megan has been writing on all kinds of topics since 2012. Her main interests include alternative medicine, running, gardening, and her kids.


A few months ago, we started working on our square foot garden. We built our own raised garden beds, put a weed barrier down, and mulched all the walkways. It was gorgeous. I even put a little two-foot, store-bought fence up to keep the dog out—and for looks. The dog made it over the little fence and started tearing everything up and digging through the weed barrier. I was so upset that I started looking at garden fences online.

I only needed something about 20 feet across and about 3 feet high. Everything I found either looked crappy or it was going to run a couple hundred dollars. So, we built one ourselves with a fully functional gate. Here’s how we did it.


  • (2) 4x4x8 ($6.77 each)
  • (6) 2x4x8 ($3.47 each)
  • (15) 4 inch x 6 foot pickets ($1.08 each)
  • (2) 3 1/2-inch hinges with hardware ($2.78 each)
  • (1) sliding lock “barrel bolt” with hardware ($3.98)
  • (1) 50-pound fast-setting Quikcrete ($4.90)
  • (96) 1/2- or 2-inch nails (I had these on hand)
  • (16) 3-inch screws (I had these on hand)

Total Cost at Lowe's: $65 for a 20-foot-long, 3-foot-high fence with a 4-foot gate.

Each additional 8 feet of fence would cost roughly $21.42, plus the cost of screws and nails.


  • Post hole digger
  • Hammer
  • Screwdriver or drill
  • Shovel
  • Level
  • Saw

1. Cut Your Wood

Cut each of your 4x4s and your pickets in half. This will give you 4-foot 4x4s and 3-foot pickets. The reason you need the 4x4 to be longer is that you need to be able to bury 1/3 of the length that will be above ground. This means 1 foot buried and 3 feet as your fence post. This gives you a 3-foot fence.

Wait until you have gotten past the post of attaching the 2x4s to the post to cut your pieces for the gate frame. You may have to adjust for the amount of space left. You will need to measure the distance of the opening of your gate to cut the other two pieces.

2. Dig Post Holes

Since we are building a 20-foot fence, we dug the post holes 8 feet apart for the main fence portion and 4 feet apart for the gate. The same spacing can be used if you are building a longer fence. The holes can be quickly dug with a post hole digger. We dug ours about 8x8 inches and 1 foot deep.

3. Place Posts

Place your 4x4 with the cut end down and centered on the hole. Make sure you look down the line of posts to make sure they are even.

4. Pour Cement

Pour 1/4 of the cement bag in each hole. Use the end of a shovel to evenly distribute it.

Fill the hole with water, anything extra will seep out into the ground—but you want enough to fully soak the cement. Use the tip of the shovel handle to mix the cement with the water.

Let it set for 20–30 minutes, and then fill the rest of the hole with the dirt you dug out.

5. Attach 2x4s

The 2x4s will serve as the fence panel frame. They should be attached a few inches from the ground and a few inches from the top of the 4x4. We used a 2x4 as a spacer for the bottom one and eyeballed the top. If your ground has no slope to it, you can use a level. Ours was a bit sloped, so we just followed the ground.

Attach the 2x4s with 2 screws on each end to the outside part of the posts. You will want them to only overlap the gate posts about halfway (see picture above).

At this point, go back and cut your gate 2x4 pieces.

Go ahead and screw the 2x4s for the gate into their spot. This will ensure they are the right size and makes it easier to install the hinge later.

6. Attach Pickets

Start from one side and nail a picket into the 2x4. Make sure the side is even with the edge of your post. If you are butting the fence up to something like we did, make sure the picket is even with the house or other fence.

Once the first picket is in place, the rest should be easy. Use one of your other pickets as a spacer if you want it to have the same look as ours. Just push a picket up to the one that is already installed like you would if you were going to attach it. Take another picket and do the same. But, only nail down the second one. Remove your spacer picket and repeat.

Once you get down to the gate post, stop attaching pickets.

7. Install Hinge

The hinge will need to be installed in the direction it has the most movement. One direction will only rotate back most of the way. The other direction will fold all the ways to the other piece.

Fold it up and install it in the same direction as you want to hinge to swing. The fold should come towards you as you are looking at it. Make sure the center of the hinge is at the spot where your (2) 2x4s come into contact with each other.


8. Finish Pickets

Once you have the hinge installed, you should be able to keep going down the fence with the pickets as before. It’s OK if the pickets overlap the hinge piece a little bit, as long as they don’t cross the center part that needs to rotate. You can always adjust your spacing by a little to accommodate. Also, make sure you adjust the location of your nail so that it won't go through the hinge.

9. Install Lock

Installing the lock is actually quite simple. The one I got came with the screws. So, you need to lock it so the bolt is through the individual piece. This makes it so you know how far apart to put them. Just make sure you screw in one piece on the gate portion and one piece on the fence portion.

That’s it! Now you have your very own DIY garden fence! I love mine! What do you think?


This content is accurate and true to the best of the author’s knowledge and is not meant to substitute for formal and individualized advice from a qualified professional.


Tina Hamlin on June 25, 2020:

How long did it take to build the fence?

Related Articles