The city originated in the 19th century as the Russian resettlement village Zubovka, named in honor of Valerian Zubov, while it was known locally as Qarachukhar. Throughout its history, Shirvan changed its names few times. The city called Zubovka prior to 1938, then was renamed to while Ali Bayramli from 1938 to 2008. The city was renamed to Shirvan by the decision of the Parliament of Azerbaijan on April 25, 2008.
Throughout its history, Shirvan has suffered from floods because of its proximity to the river and the relatively low elevation of most of the town.
The summer months are typically dry and very hot due to Shirvan's semi-desert climate. The temperature can rise to 44 °C often resulting in moderate drought conditions. In contrast, winter is cool but not severe, rarely going below -6 °C.