As all the Wifi USB dongles I've used in recent years have worked flawlessly with Ubuntu and Linux, I didn't do any extra research before buying a new one last month. Unfortunately, it didn't show up immediately, so here's what I had to do to make it work.

First, open the terminal and run lsusb and make sure there's an entry for "Realtek Semiconductor Corp.". If there isn't then either your dongle isn't connected, or the following procedure might not fix your issue.

You should get something like this, with a list of all connected USB devices:

$ lsusb
0bda:0811 Realtek Semiconductor Corp.

Now you need to install the package for "Dynamic Kernel Module Support" and the appropriate driver. Luckily, all the packages you need are available from the Ubuntu repositories.

Again, from your terminal, run:

sudo apt install module-init-tools dkms rtl8812au-dkms

Confirm, and install.

After rebooting your computer, the dongle should be detected, and be able to connect to your network.

Oh no, it suddenly stopped working!

If, after a kernel update, the dongle stops working, you need to re-build the kernel module for your new kernel version.

This can be done simply by running dpkg-reconfigure like this:

sudo dpkg-reconfigure rtl8812au-dkms

It should print some information about the kernel module being uninstalled for the previous version of your kernel, and then recompiled for your new kernel version. Reboot your computer, and the dongle should be working again!

Let me know if this solved your problem.

Update: Fixed typo, thanks anonymous commenter!