Coffea arabica is the predominant species of Coffea cultivated for consumption, although many other species exist, some of which are also consumed in a similar fashion. This tropical shrub is well suited to tropical climates, and is an important cash crop in many countries. Additionally, Coffea arabica is well suited to controlled environment cultivation and will readily set fruit in greenhouses, and even indoors as houseplants. If you're lucky enough to have a mature, fruiting coffee tree, you will be able to make use of the fruits to brew your own coffee, completely from scratch!
The fruits of a coffee tree are called coffee cherries, and when ripe, turn a dark red color and acquire a sweet flavor with a gentle tartness. These cherries are in fact edible, and in my opinion at least, taste pretty good. The outer skin and thin layer of flesh make for a tasty treat, but be careful not to bite into the hard coffee beans inside. Although coffee cherries can be eaten, the real prize are the beans within. To begin the process of preparing one's own coffee, they will have to sacrifice the fruits. The skin and flesh of the coffee cherries will be valuable in the process of fermentation in the wet processing method commonly used in coffee preparation. The dry method may also be used, although this entails leaving the entire fruits to dry, becoming prone to mold, which can be a problem in home preparation.
Homemade coffee via the wet process method:
Coffee cherries are ripe and ready for harvest when they turn a deep red color, but are still plump and relatively firm to the touch. Coffee cherries that are green or dark and shriveled up should be avoided! Understandably, you might have to collect some light red cherries as well in order to have a harvest large enough to make any meaningful amount of coffee. Furthermore, unless you have access to many fruiting coffee trees, this whole task can be difficult as not all fruits ripen at the same time. Once ripe fruits are collected the next step, fermentation, should be started as soon as possible, definitely within the same day of harvest.
Step 2: Fermentation
Each coffee cherry contains two coffee beans (or in the case of the occasional "peaberry", only a single bean is present in a cherry). These coffee beans are surrounded by a thin but slimy layer of mucilage that must be removed prior to the next step to ensure that the beans may be properly dried. The wet process method uses a fermentation step to help break down the mucilaginous layer surrounding each coffee bean. To begin this process, fresh fruit should be squeezed to eject the inner beans, and both the beans and fruit skins should be placed in a large bowl. Water should be added to the bowl, about 3 parts water per 1 part of coffee fruit should be a good ratio to ensure proper fermentation. Too much water may inhibit fermentation by diluting the enzymes too much. The skins and floating beans that rise to the surface of the mixture should be removed. The beans should be mixed occasionally with a non-metal spoon. Fermentation will be complete in as soon as 12 hours but may take as long as 48 hours. This process is complete when the beans have a rough texture that predominates the slimy texture, indicating that the mucilage has been adequately degraded.
Step 3: Drying
Beans should be left out to dry, preferably in the sun for 5-15 days. It is also possible to dry the seeds on a cookie tray left out by a window sill. When the beans are fully dry, the parchment surrounding the seed becomes brittle and will break off with ease. The bean inside the parchment must also be dry enough to crack easily when crushed. I like to bite off the end of a bean as a test - if the beans are soft, they are not ready but if they crack easily when bitten then they should be dry enough.
Step 4: De-hulling
Once the beans are dry, the parchment (or hull) needs to be removed from each bean. While there are several high-throughput ways to do this, I do it by hand. I pull apart the hull along the seam on the flat side of the bean using my finger nail. This is a very time consuming process, so alternatively, a rolling pin may be used to gently break apart the hulls (though, be careful not to break the beans in doing so).
Step 5: Roasting
This is arguably the most important step in preparing coffee. While commercial coffee roasters have access to specialized equipment that provides ideal conditions for coffee roasting, home roasters have less desirable options. Some people opt to roast beans in a popcorn popper, but I have heard that this often burns the beans and can even ruin your popcorn machine.
I would argue that roasting beans in an oven or on a skillet would be the best options for a home roaster. Either of these methods will work fine, but both likely have trade offs in terms of flavor and roast consistency. Occasionally stirring the beans is very important to ensure an even roast, and the higher the temperature the more often beans should be stirred to prevent burning. It should take about 15 minutes to complete the roasting process at ~240°F, although I have found this to vary dramatically based on roasting temperature. It's possible to roast at slightly lower temperatures (~220°F) for longer to ensure that you don't over-roast. The most important thing is to watch the color of the beans. You may be looking for either a light, medium, or dark roast, so you should pay close attention to the color of the beans during the roasting process to ensure you don't under or over shoot your goal. Beans will initially change to a yellow-ish color, grading into a gold, then brown. A final consideration is that the beans will still hold a lot of heat and will continue to cook for a couple of minutes after roasting. A fan can be used to combat this if you're afraid of over roasting.
Step 6: Enjoy!
Grind and brew your coffee as you please, and enjoy!