Depending on whether you want to keep ubuntu on the machine or not.
- Don’t keep ubuntu:
Download the freepbx iso, write it to USB drive, boot your NUC with the USB, and run the installation process. - Keeping ubuntu:
In this case I refer you to the docs http://wiki.freepbx.org/display/FOP/Installing+FreePBX+12+on+Ubuntu+Server+14.04+LTS
Good Luck!