I have a couple of tips that I have found with doing carpet. First set the peice of carpet that you have cut out in the sun for an hour or so. This will allow the carpet to stretch a little. Then you can pull it nice and tight before you glue it or staple it. I didn't use any glue on my boat deck and it has been fine. No bubbles or loose feeling carpet so far (about 6 months) and I have been out in the heat and cold/rainy days.
I started by stapling a section down and pulling the carpet tight. Then I worked my way around until it was stapled all the way around. Glue may be easier but this way the carpet is easier to replace later if needed.