natbox.io

Guides / Low memory

Make the most of a 512 MB server

Last updated 3 November 2026 · By Mohammad AlSaraf

About 10 minutes. Debian, Ubuntu and AlmaLinux, Alpine where noted. For Nano and the free trial, and any server that keeps running out of memory.

A fresh natbox server uses about 20 MB of memory, so almost all of your plan is free for your apps. Most memory problems come from app defaults written for big machines. A few settings fix them.

1. See what uses memory

free -m
ps -eo rss,comm --sort=-rss | head -15    # biggest processes, in KB
systemd-cgtop -m                          # memory per service

free shows your own server's memory, not the host's. Look at the available column: that is what your apps can still use. natbox servers have no swap, and you cannot add a swap file inside the server, so plan with real memory.

2. Turn off what you do not use

systemctl list-units --type=service --state=running

Stop and disable anything you do not need, for example a mail server or database left over from an old project: systemctl disable --now NAME. For the smallest base system, reinstall with Alpine.

3. Tune your apps

SoftwareSettingWhy
Python web appsgunicorn -w 2 or a single uvicorn processEach worker is a full copy of your app
Node.jsnode --max-old-space-size=256 app.jsKeeps the heap below your plan's memory
Java (Minecraft and others)java -Xms128M -Xmx384M -jar ...Java takes a share of all memory by default
MariaDB / MySQLinnodb_buffer_pool_size = 32M and performance_schema = OFFThe defaults alone can take 150 MB or more
PostgreSQLshared_buffers = 32MB, max_connections = 20Each connection is its own process (PostgreSQL guide)
PHP-FPMpm = ondemand, pm.max_children = 3Starts workers only when requests arrive
nginxworker_processes 1;One worker is plenty for a small site

Need a database for a small app? SQLite needs no server process at all and handles more traffic than most small projects get.

4. Cap an app so it cannot take everything

If one app grows without limit, cap it in its systemd service, so it is the one that gets stopped, not your SSH session or database:

systemctl edit myapp
[Service]
MemoryMax=300M
Restart=always

With Restart=always, systemd starts the app again after it is stopped. See keep an app running with systemd.

5. Spot out-of-memory kills

When the server runs out of memory, the kernel stops a process to free some. It vanishes with no error from the app itself. systemd records it:

systemctl status myapp       # look for "status=9/KILL" or "oom-kill"
journalctl -u myapp -n 50

If it happens often, lower the app's settings above, or give it more room.

What fits in 512 MB

Outgrowing it? Upgrade to Box (1 GB) at $1.25 a month from the client area. Your server is resized in place, with the same data, addresses and ports. More ideas: What can you run on a small VPS?

More guides: Run a Minecraft server, Host multiple websites on one server, Run several apps behind an nginx reverse proxy.