Radiofrequency ablation (RFA) offers localized and minimally invasive treatment of small-to-medium sized inoperable tumors. In RFA, tissue is ablated with high temperatures obtained from electrodes (needles) inserted percutaneously or via an open surgery into the target. RFA treatments are generally not planned in a systematic way, and do not account for nearby organs-at-risk (OARs), potentially leading to sub-optimal treatments and inconsistent treatment quality. We therefore develop a mathematical framework to design RFA treatment plans that provide complete ablation while minimizing healthy tissue damage. Borrowing techniques from radiosurgery inverse planning, we design a two-stage approach where we first identify needle positions and orientations, called needle orientation optimization, and then compute the treatment time for optimal thermal dose delivery, called thermal dose optimization. Several different damage models are used to determine both target and OAR damage. We present numerical results on three clinical case studies. Our findings indicate a need for high source voltage for short tip length (conducting portion of the needle) or fewer needles, and low source voltage for long tip length or more needles to achieve full coverage. Further, more needles yields a larger ablation volume and consequently more OAR damage. Finally, the choice of damage model impacts the source voltage, tip length, and needle quantity.