<b><i>Background:</i></b> Liver surgery is an essential component of hepatocellular carcinoma (HCC) treatment. Advances in surgical techniques and perioperative care have improved outcomes and have helped to expand surgical indications. However, liver fibrosis and cirrhosis still remain major problems for liver surgery due to the relevant impact on liver regeneration of the future liver remnant (FLR) after surgery. Especially in patients with clinically significant portal hypertension due to liver cirrhosis, surgery is limited. Despite recent efforts in developing predictive models, estimating the postoperative hepatic function remains difficult. <b><i>Summary:</i></b> In this review, we focus on the role of surgery in the treatment of HCC in structurally altered livers. The importance of assessing FLR with techniques such as contrast-enhanced CT, e.g., with the help of artificial intelligence is highlighted. Moreover, strategies for increasing the FLR with approaches like portal vein embolization and liver vein deprivation prior to surgery are discussed. Patient selection, minimally invasive liver surgery including robotic techniques, and perioperative concepts like the Enhanced Recovery After Surgery (ERAS) guidelines are identified as crucial parts of avoiding posthepatectomy liver failure. <b><i>Key Message:</i></b> The need for ongoing research to optimize patient selection criteria and perioperative care and to develop innovative biomarkers for outcome prediction is emphasized.