The steps for integrating Q2A with Wordpress are documented. There is no different procedure for Ubuntu.
Note that integration assumes you have set up Wordpress first. Integrating an already existing Q2A site into a new Wordpress instance will likely require additional work (see for instance this answer).