If I'm not mistaken, Pesto is an uncooked fresh recipe. Canning (Pressure Canner) at temperatures of 240°F for an hour or so would probably destroy all benefits of it. Best to just refrigerate or freeze as mentioned.
Home canning methods are totally different from commercial methods which often requires years of research and very expensive equipment that is inspected regularly for safety, so one should not think you can home 'can' something (especially involving oil) just because it is done commercially.
Our environment contains a lot of dirt, seen and unseen, for the C. Botulinum spore to be carried. It could exist all over the house and kitchen and even on your hands. Totally harmless in this environment, but if a spore gets into a sealed jar and the conditions are right the spore can grow and produce the toxin. This can even include vacuum-sealed (FoodSaver) containers of wet ingredients in the frig.
Just do your research first before jumping in on experimental canning projects.
Support bacteria. It's the only culture some people have.