Several factors need to be considered when installing a railing on your deck. What type of material you will be using and the direction the balusters will run, all plays a major role in determining the span between posts. Other aspects to consider are the size and height of the deck.
If the balusters will run horizontally along your deck, the 4 by 4 railing posts cannot be more that 6 feet apart. As with any deck, remember that any deck that is 2 feet or more above the ground must have a railing system. Deck railings must be a minimum of 36 inches high from the deck floor to the cap rail. Check your local building codes as horizontal railings are not safe for children and are not permitted under many circumstances.
A great number of variations can be used on deck railings, which use vertical balusters. Depending on the size of the deck you may only need a railing post at each corner and on either side of the stairs (top and bottom). The maximum distance between posts will be the length of your top rail. The top rail will need to fasten securely to a post at each end.
Rails and Balusters
If using a bottom rail, the vertical balusters will need to be fastened with two screws at both the top and bottom rails. When a bottom rail is not used, the balusters must be fastened with two screws at both the top rail and the deck joists. Deck codes will state how vertical placed balusters must be less than 4 inches apart. A 4-inch round ball must not be able to escape from any part of the deck except to go down the stairs.