See e.g. the FAQ in [1] or the documentation in [2] . The first one is more about previews but the installation of LibreOffice / OpenOffice and the requirements on your PHP configuration is also explained there. Also note that you only need LibreOffice / OpenOffice if you want to edit .doc and .docx documents.
If you need further support with that it might also help to contact the FreeNAS community how to provide such a binary to a PHP application like ownCloud.