Building shelves in your closet is one of the easier DIY projects. Depending on the size and type of closet the process may vary a little. However, for the most part, building a shelf in any situation is pretty much the same.
Decide on the type and size of shelves.
In a clothing closet, you will install one long shelf. If it is a walk-in type, you may choose to build shelves along each wall. For a linen closet, you will probably want multiple shelves but may desire them to be either designed to be moved to different heights or permanently fixed with more space between some shelves. Make measurements regarding the length of the shelves and how deep that they need to be.
For shelf lengths longer than about 3 feet, you need to plan on a center brace.
Linen closet shelves do not require a center brace. Many closet shelves are made from two pieces of 1×10 or 1×12 lumber cut to the correct length. By using two boards, it makes it easier to install and relocated if needed. Almost all shelves in clothing closets will require a center brace and if longer than 5 feet, you may elect to use a second brace. This type of shelf can be constructed of one board that is either 10 or 12 inches wide. Deeper closets require two boards.
Once you have the measurements for the length and width in hand, it is time to purchase materials.
Compute the total length of shelving stock that you will need. It is best to have shelves that run the entire length rather than trying to scab boards together. The seam can make a weak spot in the shelve that could have ugly consequences if the shelf is overloaded. Ask to inspect the lumber because it is better not to have warped boards.
Buy 1×4 or 1×2 boards for the end braces for the shelves.
For shorter shelves like you would normally find in a linen closet, 1×2 boards will almost always give you plenty of muscle to hold up the shelves. When installing longer shelves that may be asked to carry a heavier load, using 1×4 stock is a better plan.
For center braces, an “L” bracket will do nicely.
The advantage of a metal “L” bracket is that you can screw it to the shelf and to the wall with three screws each and it will give you great support. If you know that you will be overloading the shelf with heavy boxes, you may want to put a 1×4 along the back wall for the shelf to rest on top of. If you do this, you will want to put a short vertical piece where the center brace will go so that the bracket can be screwed in evenly.
Cut the wood to the desired lengths.
A table saw is the best choice for making these cuts. Some lumber yards will make the cuts on the shelf stock if you talk nicely. Cut the bracing materials to the length of the the width of the shelves. Install these along the wall at the desired height. Make sure that all braces are installed on level. Use a level and chalk line to assure that this happens. Attach all braces so that the screws into the walls drive into a stud behind the drywall.
If you are planning adjustable shelves, put in the extra braces now.
Here is a word of caution. Do not put shelves too close together or you will have trouble getting them in and out. For adjustable shelves, you just need to add in extra braces along the sides of the linen closet. A good rule would be no more than one shelf per 12 inches of height. Spacing them 16 inches would be better.
For long shelves, attach the center brace before installing the shelf.
After the shelf is in place, all that you need to do is attach the screws to the wall mount. All shelves should be screwed to the wall braces from the top down through the shelf. Painting should be done before assembling the shelves into the closet. Do not use excessively long drywall screws to attach the shelves. Screws about 1 1/4 inches will be sufficient.