You can install to a USB flash drive the same way you'd install to any external drive. Probably only minimal special guidance is needed in this situation.
Make sure the external drive that you want to install Ubuntu Server on is attached. If your computer has trouble booting from other installation media when it is, then you can defer this step to immediately after the system starts to boot from the installation media in step 2.
Boot the server install CD/DVD/USB. (If this is a live USB, then of course it must be a different drive from the USB drive you're installing on.)
Select the external drive to install to.
As part of the installation, you are asked to specify where the GRUB boot loader should be installed. Make sure it is at least installed to the master boot record of the external drive itself. You will probably not want to install it anywhere else.
In particular, please note that if the newly installed server system's GRUB is installed to the MBR of an internal hard drive, then whether or not any other Ubuntu system is installed on the machine, no system will be able to boot when the flash drive is not attached. You don't want that. (You can fix it by reinstalling your OS's boot loader to the MBR of the internal drive, but it's best simply to avoid it altogether.)
To boot the new system, you must select the drive it's on as the boot device.
This server system may or may not be highly portable, depending on how much you configure it to be dependent on other features of the machine on which it is installed:
- You should make sure the swap partition (and as discussed above, the boot loader) is also on the USB flash drive!
- By default, drives in
/etc/fstab will be listed using their UUID's (which can be viewed by running
sudo blkid). If you keep it that way when adding any new entries or modifying existing ones, your system will be much more portable, because it will be much more resilient to changes in the way devices are numbered, which often happens when hardware is substantially changed.
- If you install the 64-bit version, it will use large amounts of RAM more efficiently, and for high-performance server needs, this is typically recommended. However, the 64-bit version of Ubuntu (server or otherwise) will not run at all on a machine with a 32-bit processor.
Finally, you may want to consider alternatives to attempting to create a portable server system. For example, you might be better off installing Ubuntu Server to a virtual machine. This is automatically portable. One of the disadvantages of running Ubuntu Server from flash storage is that, if you have a very large amount of writes (which occurs in many though not all server applications), the USB flash drive will wear out muc faster than a traditional magnetic hard drive (and I believe also faster than an SSD).