If you would like to grow cocoa outdoors, you must live in the tropics.
Cocoa is a tricky plant to grow. It isn't hardy inside temperate indoor environments but it is possible to grow Cacao, although you can expect problems and even fail at your first attempt. If you have a greenhouse that can replicate the hot humid rainforest environment in which it thrives best, then you have a higher chance of not only growing a plant but actually seeing some fruit.
Your first challenge would be finding good seeds, since these have an extremely short viability of less than a week. Only those that have been newly or recently picked from the fruit are suitable for growing, so it's better to obtain a fresh fruit. Old or dried seeds just won't do.
Growing conditions must always be at a temperature of 20 to 32 degrees Celsius and humidity of at least 60 percent. If you don't have a greenhouse, use a humidifier and heater to approximate tropical conditions.
Cocoa likes rich, moist, but not overly wet soil, so spray sparingly but often. Mulching would help keep the earth moist longer, too. Theobroma Cacao is an understory plant, and it does best under indirect, filtered sunlight. Find a spot under the canopy of tall, overhanging trees where it can receive partial or about 25 percent shade. The new leaves which emerge after rains are a delicacy for many insects, you will need to spray with neem solution or another organtic insect repellant to allow vigorous growth.
Except for any major problems, you can expect your plant to flower within 4-5 years. Naturally, though, flowers are pollinated by midges - tiny flies that live in the thick, damp vegetation - so without these you would have to pollinate the flowers yourself by hand. If fertilization is successful, you should be able to see fruit within 5-6 months.
Good luck with your own chocolate tree
The first step in growing Cocoa from seed is to get a fresh cocoa pod. Mail order seeds most likely won't germinate unless they are really fresh seeds off the pod send by overnight courier. ( I have started with mail order seeds for the first try and germination rate was 0% . At my second try I got hold of a pod opened it and voila all seeds germinated in no time.)
In Thailand you can get fresh seeds for free and seedlings (about $ 0.20 each) at Chumphon Horticultural Research Centre. Several other places sell seedlings.
Open the pod and remove the seeds, there should be between 40 and 60 seeds called beans inside. The seeds are covered with a thin sweet tasting flesh - remove the flesh to prevent mold. The flesh can is removed best by rubbing the bean with some cotton cloth.
Now use some moist paper towel place the beans on it and cover with a second one (don't over water the towels). Now place the paper towels with the cocoa beans sandwiched inside into a ziplock bag, close it with some air inside and place the bag in a warm and dark place.
After 5 days open the ziplock bag and look at the beans; the cocoa beans should have germinated and developed a root as shown in the picture.
Remove the cacao beans gently from the paper towel and plant them about 1cm deep into 10cm pots or suitable plastic bags filled with a good potting mix. Put the pots in a shaded area with no direct sunlight.