The origin of Yasukuni Shrine is Shokonsha established at Kudan in Tokyo in the second year of the Meiji era (1869) by the will of the Emperor Meiji. In 1879, it was renamed Yasukuni Shrine.
Please further read at Yasukuni Shrine HP if you are interested in.