Snakes are known to have Houdini tendencies when it comes to staying confined. Aquariums make good enclosures for snakes, but the lids have to fit tightly and be clipped on. Some owners make belts to attach around the enclosure for more security. Any doors or openings in the cage need to fit tightly or the snake will push against it trying to get out. Remember, most of them are pretty slim, so they don't need that big of an opening to slip out.
The size of the enclosure should reflect the size of the snake. Many babies are insecure in a large cage and even have trouble finding their food. It's usually advisable to put young snakes in smaller enclosures. To choose a size of cage for an adult snake, first measure the length of the snake. Get an enclosure with a perimeter that measures twice the length of the snake. For instance, a three foot long snake would do OK in an enclosure 12 by 24 inches.
The exception to the above rule is arboreal, or tree-dwelling, snakes. These need a taller enclosure with lots of branches for climbing.
A snake enclosure needs a material to cover the bottom, called a substrate. Newspaper can line the bottom of the enclosure, and makes a cheap surface that absorbs moisture and is easy to change when soiled. There are also special types of carpeting available at the pet store to use as a substrate. If you have two that fit, you can use one while washing the other.
Temperature is very important in a snake enclosure. Snakes are cold-blooded animals, and have to keep warm from outside sources. Ideally, a pet snake's cage will provide several choices in temperature so the animal can regulate its body heat. This is done by heating one end of the enclosure only. Heating methods include heating pads under half of the enclosure or heat lamps. If using a light, it will need to be off during the night hours.
Thermometers should be used to monitor the inside temperature. Requirements vary from one species to another. A pet store product called a "hot rock" is widely discouraged because it has a tendency to burn pet snakes. Using a heat lamp or infrared heating panel is a far better way to provide the snake with heat. Some snakes have specific humidity requirements, too. A hygrometer can be used to monitor humidity. Misting the enclosure from time to time can help keep it more humid when necessary.
The snake will need a water bowl. Ideally it should not tip easily. For most varieties of snake, it should be large enough to take a soak once in awhile. Keeping it only about a third full helps avoid soaking the substrate. Pottery and wide based pet food dishes work well for water bowls.
A final necessity in the enclosure is a place for the snake to hide. This can be as simple as a plastic dish with a hole cut in the side. Having two, one on each end of the enclosure, gives the snake a choice. Setting up a nice enclosure takes a little time and money, but will ensure your snake has comfort and security.