Energy-dense liquid biofuels are envisaged to be required in the future long-haul heavy transportation sector to supplement battery electric vehicles in phasing-out fossil fuels. Methanol represents a versatile liquid compound featuring a considerable number of relevant applications in the chemical sector. Recently, the use of methanol as liquid fuel raised interest, as it may power engines, or may be used as building block to synthesize more complex fuels for heavy transportation sectors such as aviation, maritime transports and heavy trucks. Owing to a limited sustainable biomass feedstock potential, a careful utilization of the carbon initially contained in the biomass structure is essential to maximize the synthesis of biofuels like methanol. Thermochemical conversion is an efficient route to convert biomass to a syngas suitable for the synhtesis of biofuels. Moreover, gas conditioning performed via addition of electrolytic hydrogen to the syngas enables to increase the yield of biofuel and to enhance the overall carbon conversion from biomass to the desired biofuel. In this context, methanol production units struggle to reach commercial maturity, due to (1) large investment costs, and (2) low capacity factors. A potential solution to maximize the capacity factor involves the design of methanol production facilities able to operate in different modes, thus adapting the operation to fluctuating electricity prices, ultimately extending the time of profitable operation. Moreover, flexible production units ensure the use of electricity whenelectricity is at low price, or when available from renewable energy sources (RES), while produce electricity when electricity has high price, or when produced from fossil-fuel-based backup power plants. The goal of this Ph.D. study is to propose novel methanol production units based on biomass gasification and solid oxide cells (SOCs), to analyze them from a thermodynamic and techno-economic perspective, and to compare them against outcomes from previous studies and real bio-methanol prices. Eleven methanol production units were designed, including five flexible and six single-mode facilities. Flexible units are able to (1) produce methanol, (2) co-produce methanol and electricity, or (3) produce electricity. They can adapt to the national energy system, and more generally to fluctuations in the electricity price and RES. Conversely, single-mode facilities produce only methanol. Depending on the biomass feedstock used (either wood-chips or wheat-straw) different gasification technologies were employed. The TwoStage gasifier, a bubbling fluidized bed, a pressurized entrained flow gasifier (EFG) and the Low Temperature Circulating Fluidized Bed (LTCFB) constituted the core technologies used for the thermochemical conversion. Among the flexible units, the thermodynamic analysis showed that the production units based on the TwoStage gasifier and on a pressurized entrained flow gasifier with integrated pyrolysis showed thermal efficiencies up to 71 an 72 %, with overall carbon conversion up to 92 and 97 %, respectively. A more conventional and simpler single-mode unit based on the TwoStage gasifier and steam electrolysis via SOEC was able to convert wood to methanol with a thermal efficiency of 68 %, and overall carbon conversion of 74 %. In general, the novel flexible units constituted an excellent platform for methanol synthesis from lignocellulosic biomass. When maximizing the methanol yield, they outperformed other single-mode production units previously proposed by other authors both in terms of efficiency and overall carbon conversion. When co-producing methanol and electricity or producing electricity only, flexible units ensured performances similar to other stateof- art single-mode facilities. Straw-to-methanol conversion was possible by coupling the LTCFB gasifier with steam electrolysis via SOCs and a novel partial oxidation and char bed cleaning unit. The unit offering the highest overall carbon conversion (up to 58 %) utilized a CO2/O2 mixture as gasifying agent for the LTCFB gasifier. Compared to other works treating straw-to-methanol conversion, this coupling ensured the highest utilization of the carbon initially in the straw, as well as enhanced efficiency. However, the proposed production facilities based on straw-gasification were outperformed in terms of thermal efficiency and overall carbon conversion by methanol production units processing woody biomass. The techno-economic analysis was carried out on three 400 MWth-dry-biomassinput units: (1) the flexible unit based on the TwoStage gasifier, (2) a single-mode unit based on the TwoStage gasifier, representing one operating mode of the flexible facility, and (3) the more conventional single-mode unit based on the TwoStage gasifier and steam-electrolysis via SOECs. The conventional facility featured the lowest investment cost (390 M$2019), followed by the single-mode unit based on the TwoStage gasifier (490 M$2019), and the flexible facility (620 M$2019). The analysis of the methanol production cost showed that electricity and biomass represented the major cost factors. Minimum fuel selling prices (MFSPs) were computed for six real and projected electricity price scenarios, representing the minimum methanol selling price to achieve a zero net present value (NPV). MFSPs were generally lower for the conventional unit (92-117 $/MWhth), followed by the single-mode unit based on the TwoStage gasifier (87-127 $/MWhth) and the flexible facility (93-125 $/MWhth). It was difficult to identify a generally most costcompetitive solution, as payback periods and NPVs are highly dependent on the actual bio-methanol selling price. Typically, single-mode solutions were more cost-competitive, as their investment cost was lower, compared to a more complex flexible unit. However, subsidies might be introduced to support the facilities ensuring a better utilization of the carbon initially stored in the biomass (namely the flexible unit, and the single-mode unit based on the TwoStage gasifier). Flexible facilities became cost-competitive when consumption of electricity was limited to hours when RES were directly available, since the single-mode facilities were shut down and operated with limited capacity factors. Moreover, flexible facilities generated an additional advantage for the society, as they could produce electricity when RES like e.g. wind and solar are not available. Flexible facilities covered indeed the power production of backup power plants, whose construction could thus be avoided.