Sorafenib is a first-line chemotherapy drug for advanced hepatocellular carcinoma (HCC), but the drug resistance appeared over time. Hypoxia and acidosis are common features of the microenvironment, which contribute to the drug resistance. Here, we verified that metformin could enhance the sensitivity of HCC cells to sorafenib under hypoxia. Furthermore, metformin altered the pH levels and reversed the acidification of extracellular environment. Mechanistically, metformin promoted the ubiquitination and degradation of NHE1, a sodium-hydrogen exchanger-1, which altered the pH regulation and decreased the sensitivity of HCC cells to chemotherapy. Finally, lung metastasis mice model, subcutaneous xenograft mice model, and orthotopic recurrence mice model were used to confirm the synergistic effects of metformin in vivo. In conclusion, metformin might be a promising adjuvant therapy to enhance the effectiveness of sorafenib in HCC patients.