Manage accounts on ubuntu machine
Solution 1:
I would not try to install other versions of software on a server - too often you need to change dependencies as well. But you could provide a docker image that has the right "version" of ubuntu and configure the appropriate software your user needs.
Thats one of the main advantages of docker - install any software version without spoiling your server environment
Solution 2:
If I want to create a private enviroment for each one of them, so that everything that they install will not be shared...
This looks like the classic use cases for Containers and Virtual Machines.
Both LXD containers and Virtual Machines look --to the remote user-- like an independent system. They do not have access to software on the host system. They can run different releases of Ubuntu and different software than the host system.
LXD is best for providing a shell-only (non-GUI) Linux environment. More complex environments are possible, but the setup can be non-trivial. LXD containers can use fewer resources than a real Virtual Machine. LXD can run on a Raspberry Pi.
Virtual Machines work best for providing non-Linux environments (like Windows), and for environments that include Desktop GUIs. VMs generally require more resources, and tend to work best with hardware acceleration.