Composting within a bin is not a requirement for decomposition to occur. However, containing your compost piles in some manner serves several purposes including keeping a tidy appearance and expediting decomposition.
An ideal compost pile should be no larger than 3 ft x 3 ft x ft. This is a manageable size for turning by hand and reduces the likelihood of compaction. At this size the pile will generate enough heat to improve decomposition and kill off pests and weed seeds within the pile. Do not make the pile any larger than 5 ft x 5 ft x 5 ft.
Compost bins that facilitate regular turning can be purchased, but a more cost effective option is to build one. Compost bins can be built using a variety of materials including some that can be sourced free such as pallets. Here are plans for some do-it-yourself options https://extension.missouri.edu/publications/g6957
A common compost setup uses three bins to store materials throughout the stages. The first bin stores green material. The second bin holds the actively decomposing material and the third bin houses the finished compost that is ready to be used.
Here is a video to help with selecting the compost bin system that is right for you. https://kansashealthyyards.org/all-videos/video/composting-choosing-a-bin
Cynthia Domenghini, Extension Agent