Generally yes, selling coffee online can be very profitable.
First, coffee does sell well online, so moving good quantities to consumers is very possible. Second, demand for coffee is growing and projections for the coffee industry in 2021 and beyond are very positive.
There are other variables and details to consider, so we'll walk through some other, more specific, questions to provide a more complete answer to the question.
Does Coffee Sell Well Online?
Coffee does generally sell well online. Particularly in our post-pandemic world where in person consumer behavior has changed.
But even before that, in 2018 "Food-Navigator USA" pointed out that "Amazon food and beverage sales topped $4.75bn in 2018 making food/bev the fastest growing segment for the online retailer. Coffee products represented the most popular subcategory with year-to-date sales totaling more than $140m
More specifically, Coffee lends itself well to a monthly subscription model, which consumers tend to be likely to purchase through online store fronts of many types.
Coffee Roasting would be a form of "Vertical Integration" and yes it would increase profitability because it eliminates the costs of "the middle man" you have to pay to partially source your product.
That said, the profitability largely depends on the scale of operations. There are overhead costs involved for the purchase and maintenance of equipment, so those costs need to be offset by sufficiently high volume of sales.
An elegant solution to this problem, especially when starting up, would be to pay a roaster to generate initial sales and launch the online coffee store and switch to becoming a coffee roaster only once you are selling a high enough quantity.
Is the Coffee Industry Growing?
Yes. According to Kenneth Research "the global ready to drink (RTD) tea and coffee market is envisioned to escalate at compound annual growth rate (CAGR) of 5.3% and is expected to reach 50 billion litres (in terms of consumption) by 2021."
The same study points out that the growth rate is partly fueled by increasingly health conscious consumer behavior trends, and coffee is seen as a healthier alternative to other ready to drink beverages like carbonated soft drinks, for instance.
Why is the Demand for Coffee Increasing?
Coffee, according to Marketwatch.com is actually more consumed in the U.S. than "soda, tea, and juice combined".
In addition to being seen as a "healthier" alternative to soft drinks, the reasons for the popularity of coffee are varied, but according to Research and Markets the increase in demand for coffee can be attributed to increased home consumption (related to Covid-19), eCommerce growth in general, and growing demand for things like specialty coffee and "green" coffee consumption.
Selling coffee online, while profitable, does take some forethought.
Coffee is still, in some consumers eyes, a commodity and there is a lot of competition. Despite over-arching growth trends, and responsible and successful business plan to sell coffee online would take into account specific consumer segments. Ideally, those types of coffee drinkers that are interested in specific types of specialty coffee and perhaps are also inclined to purchase coffee through a monthly subscription model.