Self-Host n8n on Oracle Cloud (Docker + Nginx + Certbot) | Lifetime Free Setup Step-by-Step

The Day I Finally Got My Own Free Forever Automation Server (And How You Can Too)

If you want to self-host n8n on Oracle Cloud using Docker, Nginx, and Certbot for a lifetime free setup, this guide has everything you need. Let me tell you about the time I spent weeks trying to find a reliable way to self-host n8n without burning through my wallet. I tried everything—from sketchy free hosting services to repurposing old hardware that sounded like a jet engine. Nothing worked smoothly until I discovered Oracle Cloud’s free tier.

I remember thinking it was too good to be true: a genuinely free server that doesn’t disappear after a trial period? But here’s the thing—it’s real, and after helping dozens of others set it up, I can confidently say this is the most stable free automation setup I’ve found.

This isn’t about getting something “good enough for free.” This is about building a professional-grade automation server that costs nothing to run and gives you complete control. No hidden fees, no surprise shutdowns—just your own always-available n8n instance.

Why This Setup Beats Other Free Options

Most free tiers come with brutal limitations—they shut down after inactivity, throttle your CPU, or offer barely enough memory to run a basic website. Oracle’s free tier is different: you get real virtual machines with actual resources.

You’ll have two options:
– AMD instances (1GB RAM, 1 CPU core each)
– ARM instances (up to 24GB RAM, 4 CPU cores)

Yes, you read that right—up to 24GB memory for free. That’s enough to run n8n plus multiple other applications. I typically use the ARM instances because they handle workflow automation much better with that extra memory.

The catch? You’ll need a credit card for verification (they don’t charge it, just need to confirm you’re real), and some basic comfort with command line. If you’ve ever typed commands into Terminal (Mac) or Command Prompt (Windows), you’re qualified.

Getting Your Free Oracle Cloud Server

First, head to Oracle Cloud Free Tier. Select your country and complete the sign-up process. When it asks for payment method, don’t panic—they’re just verifying identity. I’ve set up multiple accounts and never been charged unexpectedly.

Once you’re in, here’s exactly how to create your instance:

  1. Click “Create a VM Instance”
  2. Name it something memorable (I use “n8n-server” but anything works)
  3. Under “Image and Shape,” click “Change Image”
  4. Select “Canonical Ubuntu 22.04” (the most stable option)
  5. Click “Change Shape” and pick an Always Free eligible shape
  6. Generate an SSH key pair (save both files securely!)
  7. Leave boot volume at 50GB (you get 200GB total free storage)
  8. Click Create

Wait about a minute while Oracle provisions your server. You’ll see a green “Running” status when it’s ready.

The Security Setup Most People Miss

This is where many setups fail—improper security rules. Oracle’s firewall (they call it “security lists”) blocks everything by default. You need to manually open ports for web traffic and n8n.

Go to your instance details → Virtual Cloud Network (Networking) → Subnet → Default Security List. Add these ingress rules:

  • Port 22 (already there for SSH)
  • Ports 80,443 for web traffic (HTTP/HTTPS)
  • Port 5678 for n8n

For each rule, set source to 0.0.0.0/0 and destination to the specific port. Without these, your server will be completely inaccessible despite being running.

Connecting to Your Server Like a Pro

Now for the moment of truth—accessing your server. You’ll need that private key file you downloaded earlier.

On Mac/Linux:
1. Open Terminal
2. Navigate to where your key is stored (usually Downloads)
3. Run: chmod 600 your-key-filename.key (makes it secure)
4. Connect with: ssh -i your-key-filename.key ubuntu@your-server-ip

On Windows:

Open PowerShell as Administrator.

Set the correct permissions on your key file using this command:powershell

icacls .\private_key_file /reset
icacls .\private_key_file /inheritance:r
icacls .\private_key_file /grant:r "$env:USERNAME:R"

After setting the proper file permissions to the private key file , retry to connect again

When you successfully connect, you’ll see the Ubuntu welcome message. Congratulations—you’re now controlling your own cloud server!

Installing the Foundation: Docker and Updates

Before installing n8n, we need to set up its foundation. First, update your server:

Step1: Update Ubuntu

sudo apt update
sudo apt upgrade -y
sudo reboot

Step2: Install Docker & Docker Compose

sudo apt install -y ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

# Check Docker status (optional)
sudo systemctl status docker

# Start & enable Docker (optional)
sudo systemctl start docker
sudo systemctl enable docker

Step-3: Run n8n Docker Container

Replace n8n.yourdomain.com with your actual domain or subdomain:

sudo docker run -d --restart unless-stopped -it \
--name n8n \
-p 5678:5678 \
-e N8N_HOST="n8n.yourdomain.com" \
-e WEBHOOK_TUNNEL_URL="https://n8n.yourdomain.com/" \
-e WEBHOOK_URL="https://n8n.yourdomain.com/" \
-v ~/.n8n:/home/node/.n8n \
n8nio/n8n

Check if n8n is running or not

sudo docker ps

Step-4: Install Nginx

sudo apt install nginx

Here is the extracted text and code from the image:


Step-5: Configure Nginx Reverse Proxy

Create a new Nginx site configuration file:

sudo nano /etc/nginx/sites-available/n8n

Paste the following configuration (replace n8n.yourdomain.com with your domain):

server {
listen 80;
server_name n8n.yourdomain.com;

location / {
proxy_pass http://localhost:5678;
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

Enable the site and reload Nginx:

sudo systemctl start nginx
sudo ln -s /etc/nginx/sites-available/n8n /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx

Step-6: Install Certbot and Obtain SSL Certificate

sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d n8n.776556.xyz

Follow the prompts to complete SSL certificate installation.

Troubleshooting Tips

If someone’s stuck at last step, couldn’t connect to server, check if Nginx is running, your subnet is public, if neither helps the iptables are most likely blocking it, try to run these commands, worked for me and many others:

sudo apt remove iptables-persistent
sudo ufw disable
sudo iptables -F
sudo iptables -P INPUT ACCEPT
sudo iptables -P OUTPUT ACCEPT
sudo iptables -P FORWARD ACCEPT

Step 7: Access n8n

Open your browser and visit:
https://n8n.yourdomain.com


You should see version information. Docker simplifies installation and keeps n8n separate from your system, making updates and maintenance much easier.

The Actual n8n Installation

Here’s where the magic happens. We’ll use Docker to install n8n with one command (replace “n8n.yourdomain.com” with your actual domain):

(Recommended) Add your user to the docker group

sudo usermod -aG docker $USER

Then log out and log back in (or reboot), so your session picks up the new group membership

docker run -d \
  --name n8n \
  -p 5678:5678 \
  -e N8N_HOST=n8n.yourdomain.com \
  -e N8N_PORT=5678 \
  -e N8N_PROTOCOL=https \
  -v ~/.n8n:/home/node/.n8n \
  n8nio/n8n

This command:
– Creates a container named “n8n”
– Maps port 5678 from the container to your server
– Sets up environment variables for proper configuration
– Creates a persistent volume so your workflows survive restarts

Wait a few minutes while Docker downloads and sets up everything. Check progress with:

sudo docker ps

You should see n8n listed as “Up.”

Why You Absolutely Need a Domain Name

I know what you’re thinking—”Can’t I just use the IP address?” Technically yes, but you’ll hit two problems:

  1. n8n will show security warnings about cookies
  2. You can’t get SSL certificates without a domain

You don’t need an expensive domain. There are many affordable domain registrars available—research and compare pricing to find one that fits your budget and has a beginner-friendly management interface.

Once you have a domain, create an A record pointing to your server’s IP address. I use “n8n” as the subdomain (so n8n.yourdomain.com). If you’re using Cloudflare, make sure to disable the proxy (orange cloud) initially—we need direct connection for certificate validation.

Setting Up Nginx and SSL Like a Enterprise Setup

Nginx acts as a traffic director—it routes incoming requests to n8n and handles SSL encryption. Install it with:

sudo apt install nginx -y

Now create a configuration file:

sudo nano /etc/nginx/sites-available/n8n

Paste this configuration (again, replace with your domain):

server {
    listen 80;
    server_name n8n.yourdomain.com;

    location / {
        proxy_pass http://localhost:5678;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

Save (Ctrl+X, Y, Enter), then enable the site:

sudo ln -s /etc/nginx/sites-available/n8n /etc/nginx/sites-enabled/
sudo nginx -t  # Test configuration
sudo systemctl reload nginx

Now for the crucial part—SSL certificates. We’ll use Certbot (Let’s Encrypt):

sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d n8n.yourdomain.com

Follow the prompts—enter your email, agree to terms, and choose whether to redirect HTTP to HTTPS (I always say yes). Within seconds, you’ll have enterprise-grade SSL encryption.

The Moment of Truth: Accessing Your n8n Instance

Open your browser and navigate to https://n8n.yourdomain.com. You should see the n8n setup screen—no security warnings, no errors.

Create your first user account (use a strong password!), and you’re in. You now have a fully functional n8n instance running on enterprise-grade infrastructure for $0.

Why This Beats n8n’s Cloud Offering

Don’t get me wrong—n8n’s cloud hosting is excellent for those who want managed service. But with this setup:

  1. It’s truly free forever – No monthly fees, ever
  2. Complete data control – Your workflows and data stay on your server
  3. No usage limits – Run as many workflows as your server can handle
  4. Custom integrations – Install additional tools alongside n8n

The tradeoff? You’re responsible for maintenance and updates. But in my experience, n8n’s Docker container rarely needs attention once set up properly.

Maintenance and Next Steps

Your server will automatically security updates if you left the default settings. For n8n updates, simply restart the Docker container:

docker restart n8n

I recommend setting up automated backups for your ~/.n8n directory—you can use Oracle’s built-in backup service or a simple cron job to copy files to cloud storage.

From here, explore n8n’s incredible automation capabilities. Connect APIs, automate social media, handle customer support—the possibilities are endless.

When You Might Want Managed Hosting

If all this seems overwhelming, n8n offers a cloud platform that handles everything for you. It’s perfect if you:

Prefer predictable monthly billing over technical setup

Need reliability without maintenance effort

Want expert support readily available

But if you enjoy tinkering and want to save money long-term, this Oracle Cloud setup is unbeatable.

Final Thoughts

I’ve set up this exact configuration for small businesses, developers, and even non-technical users willing to follow instructions carefully. Every time someone messages me saying “It worked!” I remember why I went through the trouble of documenting this process.

The internet still offers incredible free resources if you know where to look. Oracle Cloud’s free tier is genuinely one of the last great deals in cloud computing—and combined with n8n’s power, you get enterprise-grade automation infrastructure without the enterprise price tag.

Remember: the initial setup has the steepest learning curve. Once you’re through it, you’ll have not just n8n, but the confidence to host other applications on your free server.

Got stuck? There are many community resources and forums where you can find help with Oracle Cloud and n8n setup. Keep learning and experimenting!

If you encounter challenges, research online forums, documentation, and community resources for Oracle Cloud and n8n – there’s a wealth of knowledge available to help you succeed.

This is a purely literary and informational website. All content reflects personal learning and opinions, not those of any employer or government organization. No income is earned from this website.