This work focusses on biogas production from vinasse (by-product derived from ethanol distillation) with objectives of: presenting a more accurate mathematical model of anaerobic digestion of vinasse; assessing greenhouse gases and energy balances of ethanol when vinasse biogas is produced and used; and assessing the benefits of vinasse biogas used as a substitute for fossil oil and natural gas as energy source. A mathematical model of the anaerobic digestion that includes, besides methane and carbon dioxide, the hydrogen sulfide content on biogas and calculates reactors efficiency based on anaerobic biomass retention is presented. The model was calibrated and validated against data from a large-scale anaerobic reactor processing sugarcane vinasse. Comparative scenarios and set-ups were simulated to investigate the reactor's performance. Biogas flow, methane content, and yield with and without a settler were evaluated. Quality of predictions was assessed, showing high accuracy for CH4 predictions and medium accuracy for H2S and biogas flow predictions. The optimised modelled reactor was able to produce 83% more methane per volume of reactor with half the retention time. Within the distilleries, the Energy Balance (EB) and Greenhouse Gases Emissions Avoided (GHGEA) of sugarcane ethanol were calculated, including the vinasse biogas, to assess potential benefits.Biogas from vinasse was considered producing electricity or biomethane. Results show that biogas from vinasse can represent improvement in both indicators, which ranges from 3.5% improvement in EB by electricity generation with biogas to 27.5% improvement in GHGEA by replacing diesel in the mill operations. After, the use of vinasse biogas for power generation is examined and compared with fossil oil power plants in terms of energy, costs and greenhouse gas emissions in Brazil, suggesting a program to replace expensive oil power plants by biogas plants with expressive benefits in all aspects. Also, the possibility of using vinasse biomethane to replace natural gas in São Paulo State is evaluated, presenting an incentive program to this new source of energy that could promote considerable emissions reductions. Furthermore, the relation of biogas to ethanol in terms of energy supply in the next years is evaluated, showing that substantial additional energy can be obtained, and larger amounts of fossil fuels can thus be replaced.