I'm planning on making a cannon with a bore of anywhere from 2 inches to 3/4 inches.
How thick should the wall be?
If this is the real world and not a fictional setting, don't do that at home. Seriously. The difference between a cannon and a pipe bomb is how thick the walls are, and how well the end caps fit.
That guy got lucky when his rifle malfunctioned. (graphic content)
This was war rather than an accident. (graphic content)