I vented top and bottom, and this allows for convection cooling of the coils. My side gap is about an inch both sides and closed along the front and back to increase the convection.
I use a couple of deck screws at the back on the compressor framework, and a 1x2 across the front top using angle brackets to the cabinet. I glue the wood to the top using VHB double back tape.
Never been a problem in over 7 years.
500w of solar will easily keep three fridge/freezers going in the desert SW. so bet you know how I know, right?