Compressors get hot. It's what they do. A compressor takes low pressure, low temperature gas and compresses it to a high temperature, high pressure gas. This in turn goes to the condenser where it is converted (condensed - think of condensation sweating on your favorite cold beverage) to a liquid. This liquid is sent to the expansion device (often an orifice valve) where it becomes a vapor and sent to the evaporator as a low pressure, low temperature gas which is what cools the refrigerator and the process starts over again.
This is a highly simplified explanation. However, the OP gave a highly simplified description of their concern.
If the unit is otherwise functioning properly, and the only concern is that the compressor is "hot", I don't really see a problem.
Perhaps the OP can follow up with more information.