Cut 4-by-4-inch posts to 42-inch lengths, assuming the floor joists are 6-inches. Otherwise, cut the posts to 36-inches plus the height of the floor joists.
Drill two 1/2-inch diameter pilot holes, one about 1 inch from the bottom of the post and the second hole 3 inches above the first hole. Drill all the way through the posts.
Drill 1/2-inch diameter pilot holes, 1-1/2-inches deep, into the floor joists so the holes line up with the holes in the posts. Each set of holes in the floor joists is spaced 6-feet on center.
Mount the posts to the outside of the floor joists, spaced 6-feet on center. Insert a 6-inch long, 3/4-inch diameter lag bolt into each pilot hole and tighten with a ratchet wrench.
Assembling Railing Sections
Cut all the 2-by-4-inch lumber pieces required for each section of railing; you'll need to construct one section for each gap between posts. Each section requires two 68-inch pieces.
Cut the pieces of 1-by-4-inch lumber required for each section of railing. This requires eight 30-inch pieces.
Set the two 2-by-4 pieces horizontally on a flat surface, spaced 30 inches apart, with the wide side facing up. There should be 30 inches from the top of one board to the bottom of the second board.
Lay the 1-by-4 inch pieces on top of the 2-by-4s, running vertically. Space the boards evenly so there is a 4-inch gap between each board and 4-inches in from the ends of the 2-by-4s.
Attach the 1-by-4s to the 2-by-4s with 2-1/2-inch wood screws; use one screw for the top and one for the bottom. Each screw goes straight through the 1-by-4 and halfway through the 2-by-4 to ensure a strong hold.
Assembling the Railings
Hold one section of railing in place between two of the 4-by-4-inch posts. The railing must be 4-inches up from the floor and the ends of the 2-by-4s butt up against the posts.
Set scrap pieces of 4-by-4 on the floor to make it easy to achieve and maintain the proper height.
Drive 4-inch wood screws at an angle through the 2-by-4s and into the posts. It is necessary to have a second person hold the railing in place while screws are inserted.
Insert a screw through the top and bottom of each 2-by-4 for added strength.
Set a 2-by-4 on top of the railings, with the 4-inch side facing up, after each section is installed; attach with 4-inch wood screws inserted through the top and into the top 2-by-4 of the railings. When the length of the railings is longer than your 2-by-4-inch lumber, join two pieces with a 45-degree miter cut to produce a smooth seam.
This step is optional, but creates a comfortable handrail that gives the loft railings a finished look.