Wastewater treatment is traditionally considered a separate part of an industrial activity, hardly connected to the production units themselves. Scarcity of water and energy, and legal requirements for discharge of waste and wastewater will force the industry to change this approach to a more integrated concept of connecting the residual output (in terms of waste, wastewater and energy loss) to the input (in terms of materials and energy). This paper explores the possibility of using a process cycle where wastewater treatment is intended for water recycling, taking into account the mass balance of materials other than water and the energy balance as well. Three consecutive steps in this approach will be discussed: (1) investigation of the current water balance; (2) optimization of the water consuming processes; and (3) development of an overall concept for the optimized processes, with a zero discharge or virtual zero discharge of water (and other materials), and a minimal consumption of energy. The first step requires full knowledge and control of all water consuming processes, including e.g., cleaning-in-place (CIP) operations, rinsing etc. This is a very complex task, as will be shown in a case study for a brewery in Flanders, Belgium. In the second step, processes are combined by reusing waste water of a process as incoming water for another process. Examples are cooling processes, tank cleaning and truck cleaning. The final step is the regeneration of wastewater so that it can be recycled to (one of) the processes. Membrane technology plays a key role in this step. As an example, a possible treatment scheme using membrane processes will be given for the water flows in a typical medium size brewery. This scheme includes ultrafiltration (UF) for removal of particles, fibres and suspended solids, and nanofiltration (NF) for the removal of salts and organic matter. The NF concentrate is to be treated separately in a dewatering step.