The environmental impacts associated to the use of fossil fuels have greatly accelerated the research and development of renewable fuels. This chapter reviews the technical and economic challenges for biofuel production from different feedstocks. Second generation lipid-based biomass feedstocks are considered to be cost-effective and eco-friendly for biofuel production, with microalgae being the most promising. The upgrading techniques of lipid-based feedstocks are also reviewed in terms of biodiesel and green diesel production, focusing on production chemistries and approaches, product application, and associated key technical challenges and opportunities. Due to the high polyunsaturated fatty acids (PUFAs) content, microalgae oil can be used to produce biodiesel through the insertion as a middle distillate feed stream into a hydrotreating unit of a petroleum refinery. The techno-economic assessment was performed for the production of hydrotreated algal oil (HTAO), animal feed and nutraceuticals. Base case calculations were for 10 000 barrels per day of HTAO. It was considered that nutraceuticals represented only 0.05% (w/w) of the raw algae oil. Algae doubling time has a strong influence on the sales price, which might be reduced if culture agitation is increased. Process economics can be improved taking into account the algal oil content, CAPEX, and moisture content of post-extracted algal residue. Considering the current operating parameter values and co-product credits, plant gate price was estimated by ~$10/gal. However, several improvements were also identified to enhance the process economics. The trade-off between oil content and area weight productivity favors oil content at constant oil area productivity (gal·acre-1yr-1). For the limit of 100% oil content, (i.e., no solid co-product), the sale price was estimated to be $7.90/gal.