How to get Ubuntu system to boot and run entirely in RAM?

I want to dual boot Ubuntu and have it run in RAM. I have used Puppy Linux from live USB stick which ran completely in RAM, but a lot of things didn't work and so I decided to just go with a full system. With Puppy Linux, literally EVERYTHING was in RAM, but now that I want a full Ubuntu install, I only want the Ubuntu system (system files) and not all documents and files (like documents I create, save or download) in RAM. I'd like to get as much speed as possible from Ubuntu, and don't need folders such as documents, downloads, etc. loaded into RAM. I am not technical enough to create a custom Ubuntu image as some have suggested. Is there a way to achieve this?


You could run a Live Ubuntu, which can be made to boot from a USB stick or a hard disk partition, and use a persistent storage partition for your documents. Ubuntu comes with a "Startup Disk Creator" that makes this fairly easy.

This will make the documents you safe to the persistent storage partition survive a reboot, but it will reset the whole rest of your system every time you reboot. So, you can't install updates or new programs and have them survive a reboot.

This strikes me as extremely cumbersome.

However, if that's the way you want to go, you can also customize such a live system, but you'll have to know quite a lot about how Ubuntu works, how it boots, how initial ram drives work etc. Ubuntu has a help page about customizing it's Live environment (see https://help.ubuntu.com/community/LiveCDCustomization). I did this a few years ago for a group of students and even though it worked nicely, I decided it was too much work to repeat the experiment.

It would be interesting to know why you need such a strange setup.

If you're worried about the speed of running a linux system from a hard drive, don't be. Nowadays you can even run Linux over a local network link and never notice your not working on your own machine. You can even run GUI applications over an internet connection (though there the lag is noticeable).

There are a few alternatives you might consider if you're asking out of privacy needs:

A standard Ubuntu Installation comes with a "Guest User" functionality that keeps a guest's home folder in memory, so whenever you log in as a guest user, once you reboot, all the changes he made are lost.

You can encrypt either your home directory or your whole system partition. In fact, you could set it up so your system boots from an USB drive you keep on your keychain and keeps its root file system encrypted on your hard drive.