Before refrigerators were invented, food was stored in iceboxes and ice houses. These were usually kept inside the house. Food wasn't kept good as long in these houses so a better alternative was needed.
The use of ice boxes and ice houses lasted through the 1920's and 1930's, but the first artificial refrigeration system was also introduced during this time.
Refrigerators were originally made with toxic gasses. With this resulting in some deaths, Frigidair, General Motors, and DuPoint joined up to create a safer alternative.