Roasting your own coffee sounds like it needs specialized equipment, and eventually it can — but your first several batches need nothing more than a cast iron pan, green coffee beans, and an exhaust fan or open window. It's closer to popping popcorn than to any kind of precision brewing.
Sourcing green beans
Green (unroasted) coffee is sold by the pound from online roasting-supply retailers and costs meaningfully less than roasted coffee — often $6–9 per pound versus $14–20 for roasted beans of similar quality, since you're skipping the roaster's labor and packaging. Buy a small sample pack of two or three origins to start rather than committing to five pounds of one bean before you know your equipment and preferences.
The pan-roasting method
Heat a dry, heavy-bottomed pan (cast iron is ideal for even heat) over medium-high heat. Add a single layer of green beans — don't crowd the pan, roast in small batches — and stir constantly. This isn't optional stirring; beans that sit still scorch on one side within seconds of hitting roasting temperature.
The beans will go through visible stages: yellowing, then browning, then "first crack" — an audible popping sound, similar to popcorn, that signals the beans have hit roughly 385–400°F internally and are now technically coffee rather than toasted seeds. For a lighter roast, pull them within 30–60 seconds of first crack. For a darker roast, continue past first crack toward (but ideally not into) a second, quieter crack.
Telling first crack and second crack apart by ear is the single most useful skill in pan roasting, and it takes maybe three batches to learn. First crack sounds and looks almost exactly like popcorn starting up — individual, sharp, somewhat randomly spaced pops that build from occasional to fairly rapid over 60–90 seconds before tapering off. Visually, the beans are still matte and light-to-medium brown at this point, and you'll see a little smoke and chaff lifting off the pan. Second crack, if you push that far, sounds completely different: quieter, faster, and more like Rice Krispies snapping or a light crackling than distinct pops — closer to the sound of a fire crackling than popcorn popping. By the time you hear it, the beans have gone noticeably darker and shinier, because the oils are starting to migrate to the surface, and the smoke output roughly doubles. If you're ever unsure which crack you're hearing, go by the oil: dry, matte beans mean you're still at or before first crack; beans that look faintly wet or shiny mean you're already into second crack territory, whether or not you clearly heard it start.
Cooling — don't skip this step
The moment beans come off the heat, they're still roasting from residual heat and need to be cooled rapidly to stop at your intended roast level. Pour them into a metal colander and toss/fan them vigorously for a few minutes until they're cool to the touch. Skipping this step is the most common reason a beginner's "medium roast" turns out darker than intended.
Resting before brewing
Freshly roasted beans release CO2 for 12–48 hours after roasting, which makes coffee brewed immediately taste flat or overly acidic regardless of roast quality. Rest the beans in a container with a loose-fitting lid (not airtight — the gas needs to escape) for at least 12 hours, ideally 24, before grinding and brewing.
The chemistry behind that wait is worth understanding, because it explains why patience actually changes the cup rather than just being a ritual. Roasting drives a set of reactions inside the bean — the Maillard reaction and subsequent caramelization — that build flavor compounds but also trap carbon dioxide gas inside the bean's now-porous cell structure, a byproduct of the roasting process itself. A freshly roasted bean can be 1–2% CO2 by weight, which sounds small but is enough to visibly disrupt brewing: when you pour hot water over grounds that are still off-gassing heavily, the trapped CO2 rushes out and pushes water away from the coffee at the same time, which is why fresh-roasted grounds "bloom" so dramatically and can even prevent water from making even contact with the grounds. That uneven extraction is what produces the flat, sometimes sour or muted flavor people notice when they brew same-day roasted coffee.
As the beans rest, that CO2 slowly diffuses out through the same tiny fractures and pores the roast created, and the rate isn't linear — the fastest release happens in the first 24 hours, then gradually tapers off over the following one to two weeks. That's also why beans a week or two off-roast tend to taste different, usually rounder and less sharp, than beans at the 24-hour mark: extraction becomes more even once most of the CO2 has cleared out and water can fully saturate the grounds instead of fighting against gas escaping from inside them. Darker roasts degas faster than lighter roasts because the higher heat creates a more porous, more fractured bean structure, so a dark roast might taste fine at 12–18 hours while a light roast benefits from the full 24 hours or slightly more before it brews well.
What to expect from your first few batches
Uneven roasts, some scorched beans, and roast levels that don't match what you were aiming for are normal for the first handful of attempts — the timing window between "underdeveloped" and "burnt" is narrower than it sounds, and pan roasting gives you less control than a dedicated roaster. That's fine. The learning curve is fast, the ingredient cost per attempt is low, and even a slightly uneven home roast is usually more interesting than what's sitting in a grocery store bag.