Abstract: A device for the treatment of wastewater is provided. The basic device includes a wastewater inlet, a connecting means and a bioreactor. The bioreactor is a substantially water-tight compartment which has its bioreactor inlet fluidly connected to the connecting means which is fluidly connected to the wastewater inlet. Inside the substantially water-tight compartment is controlled porous media inoculated with nitrifying aerobic bacteria. Additionally, many applications will require a plurality of bioreactors to be able to handle larger loads of wastewater. The plurality of bioreactors are connected in series by a plurality of bioreactor connecting means, each bioreactor connecting means fluidly connecting one bioreactor's outlet to another bioreactor's inlet. Effluent enters the plurality of bioreactors through first bioreactor's inlet and exits the plurality of bioreactors from the last bioreactor's outlet.