As many as 400 firefighters and police officers were deployed to help extinguish the blaze and evacuate 1,800 people from nearby residences.
The German news agency DPA said all of the injured were workers at the refinery.
Footage from the scene as daylight dawned showed fires still raging and vehicles crushed under rubble.
The refinery produces 120 thousand barrels of oil a day, but it is unclear how production will be affected.
Authorities said the cause of the explosion was not yet known.
Read on EuroNews