Biofilter for treatment of black or gray water which contain organic matter to decompose. designed for urban or rural housing. the worm feeds on the organic wood contained in the wastewater, processes it and the residue is compost. likewise, the layers of the biofilter purify the water. the water treated by the biofilter can be used to feed the toilet tanks; garden watering; drip irrigation of vegetables (in case of gray water); etc