T.T.
My 1st son was just over 2 years and we are doing the same for my younger even though he has been climbing out for months now!!
When my older son got big enough we bought a Cargo (now Pier1) bunk bed and put the top bed with the rails in his room (the bottom one without the rails is in a study). This has worked great for him!! We removed the rails when he was old enough to sleep without them. Now that my younger son is ready for a big boy bed we will move the upper bunk with the rails to his room and the lower bunk to my older son's room.
We did this because we now have the option to use the beds as bunk beds or regular beds.