Creosote Oil is used to preserve Wooden Ties against rot and decay. The particular properties of this oil derived from Coal or Wood helps to waterproof and protect wood against many forms of insects and bacteria that would otherwise destroy it quickly.
You can collect it in bottles,which you can put a stack of 64 in, whereas buckets or cans don't stack.
When you make wooden ties with a bottle you lose the bottle in the process, but a bottle is cheap to make using three Glass blocks in a "V" pattern.
Creosote Oil is obtained by cooking coal or wood in a Coke Oven. It is essentially a free byproduct of the process. You will need multiple Coke Ovens to produce it in quantity as it takes several minutes to produce and cannot be sped up. The only other way to make creosote oil is to cook it in a furnace, although this is turned off by default on servers.
Aside from crafting, Creosote Oil can also be found in dungeon chests, although it's very rare, (0.2 is the default)