On your local machine, you could use hypervisor like Oracle VirtualBox to manually create virtual machines/droplets. This would allow you to manually create your own Virtual Machines on your local machine. That way you will be able to have a Virtual Machine with Ubuntu installed.
For more information, you could check the official website at:
Or you could try using Virtualbox, Vagrant and Ansible to automate the whole process. With Vagrant you should be able to automatically spin up new VMs. I would recommend taking a look at the official Vagrant documentation here:
Hope that this helps!