When installing a solid fuel heating appliance there are several sets of standards that should be considered to ensure a safe install.
The first thing to do is determine if what you have is a listed appliance. If it is it will have an identification and listing plate attached to it somewhere.
That plate will give you some basic install guidelines you will need to refer to the owners manual to get a more in-depth set of guidelines. The manufacturers instructions for a listed appliance override codes.
If it is an unlisted appliance refer to nfpa 211 for the standards for that type of install.
You also need to be sure your venting system is up to the task of safely exhausting the products of combustion. And protecting your home from that heat.
To find those standards for a masonry chimney go to chapter 10 of the most recent version of IRC. If that chimney has a stainless liner refer to that manufacturers instructions.
In the case of a prefab chimney refer to the chimney manufacturers instructions.
Tips on safe and legal stove installs
Safe install