It should work with Ubuntu without additional setup. But kernel driver for this adapter may work unstable. I suggest to install a better driver from source.

sudo apt-get install git
git clone https://github.com/lwfinger/rtlwifi_new.git
cd rtlwifi_new
make
sudo make install

This answer is applicable to hardware version 3.0 of this adapter with a Realtek chip. Previous versions should work well out of the box.

I packaged this driver to DKMS format and added it to ppa. If you instal it from there, you will not need to re-install it after kernel upgrades. It can be installed by

sudo add-apt-repository ppa:hanipouspilot/rtlwifi
sudo apt-get update
sudo apt-get install rtl8192cu-dkms

Take a look at

https://help.ubuntu.com/community/HardwareSupportComponentsWirelessNetworkCardsTP-Link

Look for TL-WN822N


TL-WN822N

Please ensure that you also install linux-firmware package after installing Ubuntu.

If you still have issues please post results of lspci and lsusb commands.