We allocated 52 participants to oral pregabalin 300 mg and 48 participants to placebo tablets before thoracoscopic surgery and for five postoperative days. The median (IQR [range]) cumulative pain scores at rest for nine postoperative months were 184 (94–274 [51–1454]) after pregabalin and 166 (66–266 [48–1628]) after placebo, p = 0.39. The corresponding scores on deep breathing were 468 (281–655 [87–2870]) and 347 (133–561 [52–3666]), respectively, p = 0.16. After three postoperative months, 29/100 participants had persistent surgical site pain, 19/52 after pregabalin and 10/48 after placebo, p = 0.12, of whom four and five, respectively, attended a pain management clinic, p = 0.24. The median (IQR [range]) morphine equivalent consumption six days after surgery was 273 (128–619 [39–2243]) mg after pregabalin and 319 (190–663 [47–2258]) mg after placebo, p = 0.35.