This varies by municipality, but in most cases yes you will need a building permit.
Most regions do not require permits for buildings which are under 10 square feet. There may also be a loophole where they do not require permits for temporary buildings so you may be able to make a case for the building being temporary if you install it on a movable foundation like railway ties.