Hello,
You can set any target folder using absolute and relative paths, for example:
$docx->createDocx('/home/user/files/output.docx');
This is explained on the practical guide page https://www.phpdocx.com/documentation/practical/creating-a-new-document, Destination path/route section.
Regards.