The worlds first oil well was drilled in 1859 by Edwin Drake at what is now called the Drake Well in Cherrytree Township, Pennsylvania. Drakes well is considered the first because it was drilled, not dug, and used a steam engine. There also was a company associated with it, and it sparked a major oil drilling boom. 
Prior to the first well drilled by Drake, there was activity in various parts of the world in the mid-19th century. A group directed by Major Alexeyev of the Bakinskii Corps of Mining Engineers hand-drilled a well in the Baku region of Bibi-Heybat in 1846. There were engine-drilled wells in West Virginia in the same year as Drakes well. An early commercial well was hand dug in Poland in 1853, and another in nearby Romania in 1857. At around the same time the worlds first, small, oil refinery was opened at Jasło in Poland, with a larger one opened at Ploiești in Romania shortly after. Romania is the first country in the world to have had its annual crude oil output officially recorded in international statistics: 275 tonnes for 1857.
In 1858, Georg Christian Konrad Hunäus found a significant amount of petroleum while drilling for lignite in Wietze, Germany. Wietze later provided about 80% of German consumption in the Wilhelminian Era. The production stopped in 1963, but Wietze has hosted a Petroleum Museum since 1970.
Oil sands have been mined since the 18th century. In Wietze in lower Saxony, natural asphalt/bitumen has been explored since the 18th century. Both in Pechelbronn as in Wietze, the coal industry dominated the petroleum technologies.
Chemist James Young in 1847 noticed a natural petroleum seepage in the coal mine at riddings Alfreton, Derbyshire from which he distilled a light thin oil suitable for use as lamp oil, at the same time obtaining a more viscous oil suitable for lubricating machinery. In 1848, Young set up a small business refining crude oil.
Young eventually succeeded, by distilling cannel coal at low heat, in creating a fluid resembling petroleum, which when treated in the same way as the seep oil gave similar products. Young found that by slow distillation he could obtain several useful liquids from it, one of which he named "paraffine oil" because at low temperatures it congealed into a substance resembling paraffin wax.
The production of these oils and solid paraffin wax from coal formed the subject of his patent dated October 17, 1850. In 1850, Young & Meldrum and Edward William Binney entered into partnership under the title of E.W. Binney & Co. at Bathgate in West Lothian and E. Meldrum & Co. at Glasgow; their works at Bathgate were completed in 1851 and became the first truly commercial oil-works in the world with the first modern oil refinery.
The worlds first oil refinery was built in 1856 by Ignacy Łukasiewicz. His achievements also included the discovery of how to distill kerosene from seep oil, the invention of the modern kerosene lamp (1853), the introduction of the first modern street lamp in Europe (1853), and the construction of the worlds first modern oil "mine" (1854). at Bóbrka, near Krosno (still operational as of 2020).
The demand for petroleum as a fuel for lighting in North America and around the world quickly grew. 
The first commercial oil well in Canada became operational in 1858 at Oil Springs, Ontario (then Canada West). Businessman James Miller Williams dug several wells between 1855 and 1858 before discovering a rich reserve of oil four metres below ground. Williams extracted 1.5 million litres of crude oil by 1860, refining much of it into kerosene lamp oil. Williamss well became commercially viable a year before Drakes Pennsylvania operation and could be argued to be the first commercial oil well in North America. The discovery at Oil Springs touched off an oil boom which brought hundreds of speculators and workers to the area. Advances in drilling continued into 1862 when local driller Shaw reached a depth of 62 metres using the spring-pole drilling method. On January 16, 1862, after an explosion of natural gas, Canada's first oil gusher came into production, shooting into the air at a recorded rate of  per day. By the end of the 19th century the Russian Empire, particularly the Branobel company in Azerbaijan, had taken the lead in production.