Bilge water treatment was studied in an upflow electrochemical reactor (UECR) in order to design a compact onboard wastewater treatment system. The influence of retention time on the removal efficiencies of chemical oxygen demand (COD) and turbidity were analyzed, and optimized using response surface methodology (RSM) for maximizing the removal efficiencies. The best operating performance was obtained at 390 min retention time and 480 min reaction time for cost effective analysis with the composition of 100% bilge water (COD o ¼ 3080 mg/L) and 50/50% seawater/fresh water, 12.8 mA/cm 2 current density, and 32 C reaction temperature. Under response surface optimized conditions, the responses were estimated as; 90% COD removal, 97% turbidity removal, outlet pH value of 8.1, mass transfer coefficient of 0.494 Â 10 À5 m/s, and mean energy consumption of 44.8 kWh/kg COD removed.