This is a list of instructions on how to add virtual ram to ubuntu 18.04 starting with a brand new Digital Ocean droplet. On Linux virtual ram is usually referred to as swap so moving worward I will reffer to it that way. There are few things to keep in mind about this: first of all using swap on SSD decreases the longevity of the hardware so DO might not be happy about this, second usually on Linux swap exist on a seperate partition and not as a file so the benefits might be limited.
First let's check if swap is enabled. If you are using a fresh DO droplet it will not be.