in the actions thingumy, on the right, in the same tab as history i think
you press "new action", then record, the circular red button, then go to image>canvas size, switch the things to pixels, add 2 to each box. then press stop in the actions window