I can tell you what I've done on my Raspberry Pi (running Raspbian, which is a Debian flavor, which Ubuntu is also based on), and it should work on any system that runs "systemd" as the startup manager.  I don't know how familiar you are with Ubuntu (or Linux as a whole), though, so I'm going to...