It needs to be as close as possible to your batteries with large gauge wire connecting it to the batteries. However, if you have lead acid batteries, the inverter needs to be isolated from them completely. Lead acid batteries will off gas and the inverter is a potential ignition source for those gasses. The inverter either needs to be in a close by, but separate, compartment or the batteries need to be in a sealed and vented (to the outside) container. If you have AGM or Lithium batteries, then the inverter can be exposed to them as they do not off gas like lead acid batteries do.