How to do a factory reset?
First, please create a backup your current configuration: system => Configuration files => exportSubmit and of your current configuration. Navigate to System → Configuration files → Export. Click on Submit and then download the XML file to your computer.
...
In order to perform a factory reset to the machine, you will need to connect a monitor and a keyboard to the server.
In CLI write:
factory factory default
...
Now you can start from scratch according to the Quickstart guide (link to QSguide) QuickStart Guide.