You can build an ant habitat yourself instead of investing in a ready-made farm. You will need a skinny aquarium or a small jar with a lid placed inside of a larger one so the ants will create their tunnels along the edge where they are more visible. Fill the larger jar with soil that preferably comes from the area where the ants lived beforehand. Keep the soil approximately one inch from the top so the ants do not climb out when you open the jar.
When finding the ants you can look for an anthill or you can order them online. Place the ants into the soil and create air holes in the lid of the larger jar. Feed them every few days by placing sugar, honey, or jam on the lid of the smaller jar. If you find the soil becomes dry, place a wet cotton ball on the outer lid for a few days.