When you replace a toilet, install a low-consumption model or a water saver. Standard toilets use 5 to 7 gallons per flush; "water-savers" use 3 to 4 gallons per flush; and new low-consumption models use 1.6 gallons, or less per flush. Until you replace your toilet, put a plastic bottle filled with water in the tank to cut down on water needed for a flush.
Generally allow about 2-in. from the back of the tool to the wall, but be sure to leave space for any sawdust collection equipment you plan to install, including the ductwork and any attachments to it or to the tool.