This article is for those of you looking for a Linux distro which can run entirely from RAM so that you can enjoy a lag-free experience!
Let’ go ahead and explore what choices we have and analyze their differences of the best Linux distros that run from RAM! Almost any Linux Distro can be made to run from RAM, but there are 2 main disadvantages we need to consider in doing that
- we need to do some hacking to get that done since this is not a feature available natively in those distros and
- they usually require very large RAM memory capacity (16GB or more), the price of which can get fairly expensive.
For these reasons, this article will focus on distros that have the inbuilt capability to run from RAM.
Let us start by look at the short version of the answer for those of you in a hurry!
The Short Version Of The Answer
Based on the pros and cons, these are the best distros for running on RAMs.
Best Distro with RAM boot: SliTaz
2nd Best: Puppy Linux
Best Distro with the smallest RAM need: TinyCore Linux
Best Distro with RAM boot for running Servers: Alpine
Comparison Table
The table below shows the comparison of the distros considered.
Distro | RAM needed | Pros | Cons |
SliTaz | 300MB | Can do network boot | 300MB RAM needed so may not be the best option for really old machines! |
Puppy Linux | 1GB | Runs best on older hardware | The GUI feels a bit dated |
AntiX | 2.7GB | Good support for older hardware through AntiX Magic software | Hard to install some apps that don’t come directly with the OS |
Alpine | 128MB | Very good documentation | No GUI, only Text console |
DSL | 128MB | Comes loaded with so many apps | Updated more than a decade ago in 2008 and hence not actively maintained |
TinyCore Linux | 19MB | Smallest footprint | Loading everything into RAM on boot is not the default behaviour, some tinkering around needed |
That is just the short version of the answer, let’s go ahead and look at the longer and more informative version and learn what were the factors considered, what other choices you have and see why the above distros are chosen as the best distros that run from RAM. Let’s start by look at the roles of RAM and Hard disks on a typical operating system.
Roles of RAM and Hard Disks
As we know RAM is volatile storage and loses all its contents when power is removed. Hence it cannot store the files we create, the apps we install or the changes we make. For this reason, all our data is stored in the Hard disk and values are copied to RAM whenever needed.
For example, let us say we open a text file for editing. The text file is copied from our Hard disk to RAM so that we can make changes to it using a text editor. When we are done making changes, we give the save command which then takes the copy in the RAM and stores it in the Hard disk. But say we remove the power while doing the editing, all changes will be lost and when we power the machine up again all the changes will be lost and the file will look the same before we made any changes.
Now that we have seen a simplistic explanation of the RAM-HDD model, next, let’s go and see how we can run the OS from RAM!
How to run the OS from RAM?
Basically, how this is accomplished is by keeping 2 copies of the entire data, one in the Hard disk and another in the RAM. On boot up, just copy all the data from the Hard disk into RAM and run from there, whenever we make any changes on the RAM’s copy, just copy over the values to the Hard disks copy too. This way we don’t need to load something from RAM every time we need that, and we have an ultra-smooth user experience!
Sounds simple, doesn’t it!
The next logical question that comes to mind is: If that’s the case why can’t the OS designers do it all the time?
Let’s look at an example and see why this is not possible!
Consider Ubuntu, the system requirement of Ubuntu is the following
- 4GB of RAM
- 25GB of hard disk space
So only one-sixth of the entire operating system, applications and data can be held in RAM at any given time. This is because of the fact that RAM per GB is expensive compared to Hard disks. For the same money that can get you 4GB of RAM, you can get 500GB of hard disk space. Due to this reason the operating systems usually store all the applications and files on your hard disk and load up only the active applications and files onto the RAM and when you close the application, the RAM space is freed up so that the next app you load can utilize that space.
If that is the case how can the above method even work? Yes, it can be provided we have a small enough operating system footprint and a big enough RAM to accommodate this footprint!
Thus the smaller the footprint of a distro, the easier it is to run that distro from less RAM. The distros that come with these small footprints are called as Lightweight distros. Let’s have a quick look at the 2 differences between the 2 classes of distros in terms of their footprints namely lightweight and heavyweight distros.
Lightweight vs Heavyweight distros
As a beginner to the Linux world you will often hear the words “Lightweight distros”, but what does it mean?
What are Lightweight Distros? Lightweight distros are Linux distributions specially made keeping old and resource constraint hardware in mind so that the user can have a responsive and lag-free computing experience even on your old hardware that has low specs in terms of processing power, disk space, and RAM.
What are Heavyweight Distros? “Heavyweight distro” is a subjective term made up by users of Lightweight distros. These distros are usually at the other end of the spectrum, with the latest and greatest feature, built keeping the best computing experience in mind and the user is expected to have a computer very good processor, lots of RAM and disk space to run it.
All the normal distros are usually considered heavyweight distros!
Some people even use the term “middle-weight” distros to denote the distros which are a mix of both!
Quick Glance At Their Differences
When you hear the term “Lightweight distros” and a number of questions will pop into your minds
Is it their ISO image size?
Is it their about their resource requirements?
Is it because they don’t come with a lot of apps?
The short answer is, generally all the above-mentioned factors like ISO image size, resource requirements, number of preloaded apps, etc are used to differentiate these 2 classes of distros. The table below shows their differences in more detail.
LIGHTWEIGHT DISTROS | NORMAL/HEAVYWEIGHT DISTROS |
Smaller ISO, usually a few hundred MBs. | In the order of GBs |
Needs very low resources like less Disk Space, less RAM, and a simple processor to run | Needs more resources |
Better suited for older hardware and comes with driver support for the older hardware. | Better suited for newer hardware |
They come with only the absolutely necessary software to run the system. | They come with everything a general user needs like LibreOffice, Calc, Browsers, etc. |
Has a simplistic desktop environment, like Xfce and LXDE | Has a fancier desktop environment like GNOME 3, Unity, etc. |
Even the apps installed are lightweight, for example, you will often find Firefox replaced by lightweight ones like Midori | The latest and greatest apps are usually used here as defaults. |
They usually have very little background services to keep the system responsive. | No such restriction is imposed on background services |
They can usually be loaded entirely into RAM and run from there for a lag-free experience. | Usually, install sizes are too big to be run from RAM |
These are the main differences between these 2 classes of distros. To learn more about their differences I suggest reading the article below where I have explained the sacrifices and trade-offs lightweight distros make in terms of usability and computing experiences to make them more suitable for use in resource-constrained hardware!
Lightweight vs Heavyweight Distros: A Comparison!
Next, let us get back to the focus of this article which is a list of distros options to run the OS directly from RAM.
Distro Option#1: SliTaz
SliTaz offers a good balance of size and features. According to the official website http://www.slitaz.org/
“SliTaz GNU/Linux is a free operating system working completely in memory from removable media such as a CD-ROM or USB key. It is light, speedy and fully installable on a hard drive. SliTaz is distributed in the form of a LiveCD that you can easily burn to a cdrom and boot from. When the system is running you can eject the LiveCD and use your CD drive for other tasks. The Live system provides a fully-featured, working graphical distro and lets you keep your data and personal settings on persistent media. The system can be extended with the Tazpkg package manager and security updates are provided for the cooking and stable versions.”
You can make SliTaz run from RAM but doing a frugal install to the drive and make the default behaviour to be able to run from RAM.
ISO size: 43MB
Kernel-Version: 3.2
Ram needed: 300MB
Pros
- Runs OpenBox LXDE desktop
- Can be installed inside windows to make trying out easier
- Can do network boot
-
Comes loaded with many preinstalled apps like
- Midori browser
- Transmission torrent client
- Text editor
- Calculator
- Basic spreadsheet
Cons
- 300MB RAM needed so may not be the best option for really old machines! (we are nit-picking here!)
Distro Option#2: Puppy Linux
Puppy Linux is one of the best lightweight distros out there that can run from RAM
Pros:
- Runs best on older hardware
Cons:
- The GUI feels a bit dated
- 1GB Ram needed
Distro Option#3: Antix Linux
According to their official website
“antiX is a very flexible linux distribution. You can run it live from a cd, live from a usb stick (with persistence ie changes are saved on reboot) as well as setting up a frugal-install from an internal or external hard drive. Of course, you can install to internal and external drives, sticks, cards etc. You can even run it live, add/remove applications, customize it, remaster it and then install. All your changes will carry over to install!”
Pros
- Relatively popular distro (ranked 11 at distrowatch.com for popularity)
- Good support for older hardware through AntiX Magic software
Cons:
- Hard to install some apps that don’t come directly with the OS
- 2.7 GB or more RAM is needed
Distro Option#4: Alpine
Alpine Linux is a security focussed lightweight distro. According to the official website https://alpinelinux.org/
“Alpine Linux is an independent, non-commercial, general purpose Linux distribution designed for power users who appreciate security, simplicity and resource efficiency.”
Alpine Linux supports 3 modes of installation
- Diskless mode: runs from RAM, changes are lost on reboots
- Data mode: regular mode, runs from hard disk
- Sys mode: a combination of the above 2, copies everything on boot to RAM, which is what we need!
ISO size: 81MB
Kernel-Version: 4.4
RAM: 128MB
Pros
- Has inbuilt support for booting into RAM
- Busybox command-line utilities
- Best For Server and Embedded Scenarios
- APK Package manager is very good
- Very good documentation
Cons
- No GUI, only Text console
Distro Option#5: DSL
DSL stands for Damn Small Linux. This distro is targeted for Desktops, originally developed as part of an experiment to see what can realistically fit into 50MB live CD, later grew into a community project with so much work put into this distro to make it into what we see today!
According to the distro’s official webpage, this small 50MB iso packs the following applications!
“XMMS (MP3, CD Music, and MPEG), FTP client, Dillo web browser, Netrik web browser, FireFox, spreadsheet, Sylpheed email, spellcheck (US English), a word-processor (Ted), three editors (Beaver, Vim, and Nano [Pico clone]), graphics editing and viewing (Xpaint, and xzgv), Xpdf (PDF Viewer), emelFM (file manager), Naim (AIM, ICQ, IRC), VNCviwer, Rdesktop, SSH/SCP server and client, DHCP client, PPP, PPPoE (ADSL), a web server, calculator, generic and GhostScript printer support, NFS, Fluxbox and JWM window managers, games, system monitoring apps, a host of command line tools, USB support, and pcmcia support, some wireless support.”
ISO size: 50MB
RAM: 128MB RAM can make the entire system run from RAM to give an ultra-responsive experience!
Kernel-Version: 2.4.31
Pros
- Designed to run everything from RAM
- Can run inside windows so easy to try out!
- Has SSH, HTTPD and FTP capabilities out of the box
- Comes loaded with so many apps
- Can be extended to suit user needs
- Apt package manager
Cons
- The GUI looks very outdated, a direct result of the trade-off to limit the size and increase speed.
- Updated more than a decade ago in 2008 and hence not actively maintained
Distro Option#6: TinyCore Linux
According to www.tinycorelinux.net
“Tiny core is a unique and minimalist distribution of the Linux operating system and tools”
TinyCore comes with bare essentials and it is the duty of the user to install whatever app he/she needs. Installation of apps can be done using a GUI tool so you don’t need to go for command line installation processes!
ISO size
Tiny core comes in 3 variants
- Core: Only CLI (11MB)
- TinyCore: Core + GUI Desktop (16MB)
- CorePlus: TinyCore + List of configurable window managers and support for WiFi (106MB)
Kernel-Version: 4.2
RAM needed: 19MB
Pros
- Smallest footprint
- Modern looking desktop UI
- BusyBox command-line utilities
- Very minimal iso
Cons
- Loading everything into RAM on boot is not the default behaviour, some tinkering around needed
- User need to install whatever apps he/she needs
The Results
Based on the pros and cons, these are the best distros for running on RAMs.
Best Distro with RAM boot: SliTaz
2nd Best: Puppy Linux
Best Distro with the smallest RAM need: TinyCore Linux
Best Distro with RAM boot for running Servers: Alpine
These results are just my take on things, look through the pros and cons and choose the one that best fits your needs! As mentioned at the beginning of the article theoretically you can tinker any distro to run from RAM. You can even install heavyweight distros into RAM as long as you have enough RAM space. To run ubuntu entirely off RAM I suggest you have 16GB or 32GB of RAM!
Summary
Here is the comparison table again!
Distro | RAM needed | Pros | Cons |
SliTaz | 300MB | Can do network boot | 300MB RAM needed so may not be the best option for really old machines! |
Puppy Linux | 1GB | Runs best on older hardware | The GUI feels a bit dated |
AntiX | 2.7GB | Good support for older hardware through AntiX Magic software | Hard to install some apps that don’t come directly with the OS |
Alpine | 128MB | Very good documentation | No GUI, only Text console |
DSL | 128MB | Comes loaded with so many apps | Updated more than a decade ago in 2008 and hence not actively maintained |
TinyCore Linux | 19MB | Smallest footprint | Loading everything into RAM on boot is not the default behaviour, some tinkering around needed |
And with that, I will conclude this article!
I hope you guys enjoyed this article and learned something useful.
If you liked the post, feel free to share this post with your friends and colleagues!
Related Articles
Here are some of my other articles that might interest you!
A Step By Step Plan To Learn Linux..!
Best Linux Distro For Workstation: Analysis and Comparison!!
A Complete Guide For Choosing A Distro For Your Computer’s Specs..!!
Best Distro For Software And Hardware Support: An Analysis.!!
Distro-Hopping, What, Why & How Explained!
Reasons Behind The Existence of SO MANY Linux Distros: An Analysis!