In the future energy infrastructure there is a considerable potential for biogas and, in particular, for biomethane as a natural gas substitute. Among the alternatives of upgrading biogas to biomethane, this work focuses on membrane permeation. Taking cellulose acetate as membrane material and spiral-wound as membrane configuration, five layouts are assessed. All layouts have the same biogas plant rated at 500 m(3)/h (STP), yet they may adopt: (i) one- or two-stage permeation, (ii) permeate or residue recycle, and (iii) a water heater or a prime mover (internal combustion engine or a micro gas turbine) to exploit residues as fuel gas. Since residues are consumed, all layouts have zero emission of methane into the atmosphere. The membrane material is modeled considering the phenomenon of plasticization; the membrane modules are described by a crossflow permeation patterns without pressure drops. The results indicates that specific membrane areas range from 1.1 to 2.4 m(2)h/m(3) (STP), specific energy from 0.33 to 0.47 kWh/m(3) (STP), and exergy efficiencies from 57.6% to 88.9%. The splitting of permeation over two stages and the adoption of water heater instead of prime movers is a convenient option. The preferred layout employs a single compressor, a two-stage membrane permeation at 26 bar, a water heater fueled by the first-stage permeate, and a second-stage permeate recycle. Assuming a biomethane incentive of 80 (sic)/MWh(LHV) and a project life of 15 years, the total investment of this plant is 2.9 M(sic), the payback time 5 years and the net present value 3.5 M(sic). (C) 2015 Elsevier Ltd. All rights reserved.