Yes but it wasn't very easy. In 1872, the Meiji government passed the Firearms Control Law (銃砲取締規則). Under these regulations, only licensed gun merchants were allowed to sell firearms, and had to keep a strict log of who they had sold these weapons to. Ex-military officers were allowed possession of their old firearms, but they would be specially marked and stamped as well as strictly recorded. It was a crime to lose a firearm without reporting its loss. Essentially only hunters could really purchase firearms.
In 1899, a new law called the Firearms and Explosives Control Law (銃砲炸薬取締規則) was passed, which made it much more difficult. Under this new law, the gun trade was brought under full government control. Even the transfer and transport of weaponry was nationalised where it was before open for tender. In fact, even the internal transfer of weaponry within the military or police required direct authorisation by senior officials. Of course it was still possible to acquire a gun, but the number of exceptions had dropped drastically.
The defining work of scholarship is Endo (2012) - 1872年銃砲取締規則の制定過程 : 近代日本における武装解除と銃社会規制の端緒. Which you can access from this linklink. It's in Japanese though.