The invention relates to a coffee roasting machine which comprises a head cover, a rack, a roasting heater, a roasting container and a bean shell storing container. The roasting container and the bean shell storing container are detachably arranged on the rack, the roasting container comprises a container body and a stirring component, the roasting heater is connected with the container body, the stirring component is used for being connected with a drive motor and rotatably arranged in the container body, the container body is provided with an opening, the head cover movably covers the opening of the container body, the end, far away from the opening, of the container body is provided with multiple material discharging channels, and the bean shell storing container is arranged at the end, provided with the material discharging channels, of the container body. When the roasting heater conducts heating to roast coffee beans in the roasting container, the coffee beans are rotated by means of the stirring component, bean shells and coffee beans are separated, the separated bean shells drop into the bean shell storing container though the material discharging channels, automatic cleaning and collecting of the bean shells in the roasting process are achieved, and therefore the roasting efficiency is improved.