Although you can technically roast coffee at home, it's not recommended unless you have the proper equipment. This is because coffee roasting is a delicate process that requires careful control of temperature and airflow. If you don't have the right equipment, it's very easy to ruin the beans.
That being said, if you're determined to roast your own coffee at home, there are a few things you should know. First of all, you'll need green coffee beans. These can be purchased online or at some specialty stores. Once you have your beans, they need to be roasted in an evenly heated environment - this is where most people run into trouble. A good rule of thumb is to start with a lower temperature and gradually increase it over the course of about 20 minutes. You'll also need to keep an eye on the color of the beans; when they reach a dark brown, they're done roasting.
After roasting, the beans need to be cooled quickly so they don't continue cooking. The best way to do this is to pour them into a metal colander and stir them around until they're cool to the touch. Once they're cooled, they can be stored in an airtight container for up to two weeks (although freshness declines after day seven or eight).
So there you have it - everything you need to know about roasting coffee at home (albeit with a disclaimer that it's not recommended!).