Skip to main content

Command Palette

Search for a command to run...

The Server Engine

Installing Docker and Turbocharging Memory with Swap

Updated
2 min read
The Server Engine

If you followed our saga last week, you already have an Oracle Cloud instance created and SSH access working. But for now, it's just an empty box. Today, we are going to install the heart of our infrastructure: Docker.

And we have an extra challenge: since we are using the AMD Micro instance (free tier), we only have 1GB of RAM. If we try to run n8n and a WhatsApp API here, the server will crash in 5 minutes.

I'll show you how I solved this using an old SysAdmin trick: Swap.

1. The "Root" Docker Installation

We could use fancy panels, but they consume memory. On small machines, every megabyte counts. That's why I did the installation via the terminal, which is clean and efficient:

Bash

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

Simple as that. With this, we have the most powerful container engine in the world ready to run.

2. The 1GB RAM Problem

Modern applications like Evolution API (for WhatsApp) use browsers behind the scenes. They "eat" memory. With only 1GB of physical RAM, Linux triggers the OOM Killer (Out of Memory Killer) and shuts down your programs out of nowhere.

The solution? Create Virtual Memory (Swap) using hard drive space.

3. Creating 4GB of "Extra Memory"

Since Oracle gives us 50GB of disk space, I decided to allocate 4GB for Swap. This works like a "lung": when RAM fills up, the server uses the disk so it doesn't freeze.

The process involves creating a file, setting security permissions, and telling Linux to use it:

Bash

sudo fallocate -l 4G /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

I also adjusted Swappiness to 10, ensuring the system prioritizes fast RAM and only uses the disk in emergencies.

Result: We now have a server "armored" against memory shortages, ready to host n8n and Evolution API without fear of crashes.

On Thursday, I will reveal how I access all of this externally without opening a single security port on the firewall.