This guide assumes you are using Ubuntu and have some basic linux command-line know-how.
Download the server https://www.factorio.com/download-headless/stable:
In this article, I will share some of my experience on installing NVIDIA driver and CUDA on Linux OS. Here I mainly use Ubuntu as example. Comments for CentOS/Fedora are also provided as much as I can.