Elektrine lite

← Feed

@dan@upvote.au

Is Debian on 256 MB RAM no longer possible?

2026-05-27 04:42 UTC

I run dnstools.ws which lets you perform DNS lookups, pings, traceroutes, etc. from 25 locations around the world. Each location is powered by a VPS running Debian, running a C# service that’s compiled to native code ahead-of-time using Native AOT. It uses ~60MB RAM. Six of the the locations are powered by tiny “NAT VPSes” (native IPv6 with shared NAT IPv4) that only cost a few dollars a year, sponsored by various server providers. These usually have 256 MB RAM and 4-5 GB disk space. This is great with OpenVZ and LXC. Since they’re containers that share the kernel with the host, kernel memory doesn’t count towards the container’s memory limit. I’m using ~75 MB RAM on those systems: ~60MB for the DNSTools worker and ~15MB for everything else (sshd, systemd, cron, rsyslogd, and unattended-upgrades). Plenty of room left. I also have a few KVM systems with 256 MB RAM. These are what I’m struggling with. Debian 13 (Trixie) increased the minimum hardware requirements from 256 MB to 512 MB RAM. It seems like this is a hard requirement - When running on a system using 256 MB RAM, the installer complains about having too little RAM, and OOMs during the installation. Even with a successful installation (e.g. upgrading from bookworm to trixie), it kernel panics on boot: “System is deadlocked on memory”. I could try debootstrap to bootstrap a basic system, or Clonezilla to clone a working disk image over the network, but I think I’d hit the memory deadlock too. Does Debian have smaller kernel images for VM environments, that use less RAM? Or should I just give up on Debian for this use case? Does anyone have a recommendation for another distro I should use? I’ve been considering trying Alpine. C# does support compiling to use musl instead of glibc, so that’s not an issue. I’m also not tightly-coupled to systemd and can get rid of it. I can mount a custom ISO on the systems, so booting from an ISO isn’t an issue. Thanks!

Replies (14)

  • @agentTeiko@piefed.social 2026-05-27 04:49

    I mean you could just compile your own kernel from the Debian source build and use the build menu to pull out everything you don’t need to get the memory requirements down. Then bootstrap with your kernel.

    Open ##2889268

  • @Munkisquisher@lemmy.nz 2026-05-27 04:55

    Tinycore is a 23mb Linux desktop that runs in 46mb of ram. Microcore is the headless version that runs in 28mb of ram.

    Open ##2889291

  • @RIotingPacifist@lemmy.world 2026-05-27 04:54

    Seems like you could use swap if this is just running out during parts of the install.

    Open ##2889318

  • @mlfh@lm.mlfh.org 2026-05-27 05:04

    The grub command line options at the beginning of this article might help get your system booted without the memory deadlock, and then you can make further adjustments as needed: tierhive.com/…/debian-13-minimal-guide-reduce-ram… Alpine is great for exactly this kind of thing, though, and I use it often in embedded environments where resources are at a premium. Just do some good reading up on it beforehand, since can be very different if you’re used to debian and systemd.

    Open ##2889386

  • Those are customized installs to use the most minimal disk and memory footprint possible. You sure they run a MODERN release of Debian?

    Open ##2889442

  • @adarza@lemmy.ca 2026-05-27 05:34

    tui installer on netinst iso (13.4) says 320mb is required: This system does not have enough memory to be supported by this program. At least 320 megabytes of memory are required. If you continue, unpredictable and broken behavior will likely result. You should reboot now and add memory or find some other program to use. it does allow you to continue anyway, which switches to ‘low memory’ expert mode install. 320mb also gives this error. 384mb does not, but still enters the special install mode, where i was able to load enough installer components to set up networking to start an install (virt-man). it did lose part of the display font partway through but it did finish and reboot ok.

    Open ##2890081

  • @rbn@sopuli.xyz 2026-05-27 06:03

    Another thought: is it required for your service to physically run in 25 locations? Couldn’t you have one (more powerful) main instance which accesses the other servers via SSH to execute whatever command is required?

    Open ##2891392

  • @QueenMidna@lemmy.ca 2026-05-27 06:56

    I wonder how much smaller you could get it by just cross-compiling to WASM and using some of the edge hosts out there

    Open ##2891768

  • @sun_is_ra@sh.itjust.works 2026-05-27 10:51

    Why not give Gentoo a try? It natively require you to compile the kernel which is perfect because you get to drop all the drivers and features you don’t need. Gentoo package manager also compile every package in the system which is very slow but it gives you lot of control over what features you want from each package. You’re no longer required to install X server just because one package provide GUI support. End result is less memory for kernel and less memory for most other apps. 256 should be doable but just to be sure try running “sysrescuecd” which is based on gentoo. first to see if it would work

    Open ##2896540

  • @utopiah@lemmy.ml 2026-05-27 06:58

    Alpine in container is typically considered the smallest one can conveniently use (not going through LinuxFromScratch or writing your own OS). I did some tinkering a while back ending up with 14.29MiB memory footprint.

    Open ##3222177

  • @non_burglar@lemmy.world 2026-05-27 05:47

    You can get creative with Linux. 1. Install on 512mb, remove and trim system services, and lower the memory. Running KVM is by itself likely not going to let you do that, I suspect. 2. Use Alpine as you say.I run many alpine containers on between 25MB and 60MB, I give them 256MB, but it's way overkill. Regarding alpine, be prepared to find differences from glibc and systemd distros in places you don't expect. PHP (god forbid you should need it) is a right mess on alpine. Mongodb will not work on alpine. Stuff like that. I may take some challenge on this, but the tcpip stack seems faster on alpine than in debian, at least in my use cases.

    Open ##3222178

  • I don't know enough to help, but I'm commenting in the hopes it reaches someone who does.

    Open ##3222179

  • @whatiswrongwithyou@lemmy.ml 2026-05-27 16:44

    I use low memory vps systems from lists maintained by the lowendbox website but these are even smaller! What providers do you use that accommodate such tiny systems? I never really run up against the 1/2 to 1gb barrier on sub $10/y vpses so maybe I could switch to your providers and save some cash!

    Open ##3222180

  • @marcie@lemmy.ml 2026-05-31 05:45

    https://en.wikipedia.org/wiki/Comparison_of_lightweight_Linux_distributions heres a pretty good resource, bit of a tangent but i got a ton of shithouse computers with very low ram and i think alpine/postmarketos is the best choice. ive gotten kde, cosmic, and so on running on tons of terribly old computers with it, typically with no more than 1-2gb of ram. its also good for computers with only 256mb or so. after a certain point you need to just load your OS into ram entirely in order to have any ability to handle modern applications on very old hardware, in this case you should consider buying ram for your very old hardware (it comes cheap for the top compatible tech when its 90s hardware) if you like to use it as a sort of display piece for visitors to use. there are a couple of distros in that list that can handle being stored in ram. but obviously youre a bit different because you can just run it all on a vps. still probably best to go with alpine despite the operational differences of the mainline fully featured modern desktop environments i feel cosmic de works the smoothest on old hardware, strangely enough.

    Open ##3222181