This blog post provides a step-by-step guide that works worry free :

Thanks to the author !

As the versions are regularly upgraded, I would suggest you to parse the file : /etc/init.d/unifi and update the path (java home and controller application, if needed). Then, run the commands :

update-rc.d unifi defaults

Then, test the startup script with :

/etc/init.d/unifi restart

This man-page gives you instructions about managing services at startup :