When it comes to how close you can put a treadmill to the wall, there are a few things to keep in mind. For starters, you'll want to make sure that there's enough clearance for the moving parts of the treadmill, like the belt and the deck. You'll also want to consider the height of the control panel and any displays, as well as the height of the safety key.
In general, you'll want to leave at least two feet of clearance between the wall and the treadmill. This will give you enough space to safely use the treadmill, and it will also help to prolong the life of the machine. If you have a small space, you may be able to get away with less clearance, but it's always better to err on the side of caution.