Installation, SSL & Your First Workflow
Replace your $50/month Zapier subscription with a self-hosted automation platform on a $5/month VPS.
RamNode KVM VPS (1GB+), Ubuntu 24.04, SSH access, a domain name
~30 minutes
1GB ($5/mo) minimum, 2GB ($10/mo) recommended
Looking for a quick-start guide? Check out our standalone n8n Deployment Guide for a streamlined setup walkthrough.
Why n8n Is the Automation Tool of 2025
n8n went from 45,000 to over 157,000 GitHub stars in 2025, making it the fastest-growing open-source project of the year — and for good reason. It's a visual workflow automation platform that does everything Zapier and Make do, except you own it, you host it, and you never pay per-task pricing again.
💰 The Math That Makes This Worth Your Time
| Platform | Monthly Cost | Task Limits |
|---|---|---|
| Zapier Pro | $29.99/mo | 750 tasks |
| Zapier Team | $103.50/mo | 2,000 tasks |
| Make Pro | $16.67/mo | 10,000 ops |
| n8n on RamNode | $5/mo | Unlimited |
A single RamNode KVM VPS at $5/month gives you unlimited workflows, unlimited executions, and zero per-task fees. Over a year, you're saving anywhere from $200 to $1,200 compared to SaaS automation tools — and you get full control over your data.
Prerequisites
- • A RamNode KVM VPS (1 GB RAM minimum, 2 GB recommended) running Ubuntu 24.04
- • A domain name with DNS pointed to your VPS IP (e.g.,
n8n.yourdomain.com) - • SSH access to your server
- • Basic comfort with the Linux command line
Don't have a VPS yet? RamNode's KVM plans start at $4/month and include up to $500 in annual credits for new accounts. Spin one up at ramnode.com and you'll be running n8n in under 15 minutes.
Step 1: Prepare Your Server
SSH into your VPS and start with a fresh system update:
sudo apt update && sudo apt upgrade -yInstall Docker and Docker Compose. Docker keeps n8n isolated from the rest of your system and makes upgrades trivial:
# Install Docker
curl -fsSL https://get.docker.com | sudo sh
# Add your user to the docker group (log out and back in after)
sudo usermod -aG docker $USER
# Install Docker Compose plugin
sudo apt install -y docker-compose-pluginLog out and back in so the group change takes effect, then verify:
docker --version
docker compose versionStep 2: Set Up the Project Directory
Create a clean directory structure for your n8n deployment:
mkdir -p ~/n8n-docker && cd ~/n8n-docker
mkdir -p n8n_data caddy_data caddy_configWe're going to use Caddy as our reverse proxy. Unlike Nginx, Caddy handles SSL certificate provisioning and renewal automatically via Let's Encrypt — zero configuration, zero cron jobs, zero certificate expiry surprises at 3 AM.
Step 3: Create the Docker Compose File
Create your docker-compose.yml. Replace n8n.yourdomain.com with your actual domain and set a strong encryption key:
version: "3.8"
services:
caddy:
image: caddy:2-alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- ./caddy_data:/data
- ./caddy_config:/config
networks:
- n8n-network
n8n:
image: docker.n8n.io/n8nio/n8n
restart: unless-stopped
environment:
- N8N_HOST=n8n.yourdomain.com
- N8N_PORT=5678
- N8N_PROTOCOL=https
- WEBHOOK_URL=https://n8n.yourdomain.com/
- N8N_ENCRYPTION_KEY=your-strong-encryption-key-change-this
- GENERIC_TIMEZONE=America/New_York
- N8N_SECURE_COOKIE=true
volumes:
- ./n8n_data:/home/node/.n8n
networks:
- n8n-network
networks:
n8n-network:
driver: bridgeA few things worth noting:
- N8N_ENCRYPTION_KEY — Encrypts your stored credentials. Generate a strong one with
openssl rand -hex 32and save it somewhere safe. If you lose this key, all your saved credentials become unreadable. - WEBHOOK_URL — Tells n8n the public URL for incoming webhooks. Without it, webhook trigger nodes will generate internal URLs that external services can't reach.
- N8N_SECURE_COOKIE — Ensures session cookies are only sent over HTTPS.
Step 4: Configure Caddy for Automatic SSL
Create the Caddyfile:
n8n.yourdomain.com {
reverse_proxy n8n:5678
}That's it. That's the whole Caddy configuration. Caddy will automatically obtain a Let's Encrypt SSL certificate, configure HTTPS, redirect HTTP to HTTPS, and handle certificate renewals. Compare that to writing Nginx config blocks, installing Certbot, configuring renewal hooks, and debugging certificate chain issues.
Step 5: Configure Your Firewall
Before starting n8n, lock down your VPS. Only three ports need to be open:
sudo ufw allow 22/tcp # SSH
sudo ufw allow 80/tcp # HTTP (for ACME challenge and redirect)
sudo ufw allow 443/tcp # HTTPS
sudo ufw enableStep 6: Launch n8n
Make sure your DNS A record for n8n.yourdomain.com points to your VPS IP, then:
cd ~/n8n-docker
docker compose up -dWatch the logs to confirm everything starts cleanly:
docker compose logs -fYou should see Caddy obtain the SSL certificate and n8n start on port 5678. Once you see n8n ready on 0.0.0.0, port 5678, open your browser and navigate to https://n8n.yourdomain.com.
Step 7: Create Your Owner Account
On first visit, n8n presents a setup screen. Create your owner account with a strong password. This is the admin account — it has full access to all workflows, credentials, and settings. Once you're in, take a moment to explore the dashboard. You'll see the workflow canvas, which is where you'll spend most of your time.
Step 8: Build Your First Workflow — Uptime Monitor
Let's build something immediately useful: a workflow that monitors a website every 5 minutes and emails you if it goes down. This is a workflow that would cost you tasks on Zapier every single time it runs — here, it's free.
Create the Workflow
- Click "Add workflow" in the n8n dashboard
- Name it
Website Uptime Monitor
Add a Schedule Trigger
Click the + button to add your first node:
- Search for "Schedule Trigger"
- Set it to trigger every 5 minutes
- This replaces the need for external cron jobs — n8n handles scheduling natively
Add an HTTP Request Node
Click the + after the Schedule Trigger:
- Search for "HTTP Request"
- Set the method to GET
- Set the URL to the website you want to monitor
- Under Options, set Timeout to
10000(10 seconds) and toggle on Full Response
Add an IF Node for Conditional Logic
Click the + after the HTTP Request:
- Search for "IF"
- Set Value 1 to
{{ $json.statusCode }} - Operation:
is not equal to - Value 2:
200
This routes the workflow into two paths: one for when the site is down (status ≠ 200) and one for when it's healthy.
Add an Email Node on the "True" Path
On the true output (site is down), add a Send Email node:
- Configure your SMTP credentials (Gmail, SendGrid, or your mail server)
- Subject:
⚠️ ALERT: Website Down — {{ $json.statusCode }} - Body:
Your website returned status code {{ $json.statusCode }} at {{ $now.toISO() }}.
Add Error Handling
Click on the HTTP Request node, go to Settings, and enable "Continue On Fail". This ensures that if the request times out or the server is completely unreachable, the workflow continues instead of stopping dead.
Then add another IF node that checks for errors:
- Value 1:
{{ $json.error }}— Operation:is not empty - Route this to the same email alert node
Activate the Workflow
Click the "Active" toggle in the top right corner. Your workflow is now live and will check your website every 5 minutes, 24/7, at zero marginal cost.
What You've Built
You now have a fully self-hosted n8n instance with:
- • Automatic SSL via Caddy and Let's Encrypt
- • Docker-based deployment for easy upgrades and isolation
- • A working uptime monitor that runs on a schedule with conditional alerting
Most importantly, you have a foundation. Every workflow you build from here adds value to your $5/month VPS without adding cost.
Quick Reference: Essential n8n Commands
# View logs
docker compose logs -f n8n
# Restart n8n
docker compose restart n8n
# Update n8n to latest version
docker compose pull n8n
docker compose up -d n8n
# Stop everything
docker compose down
# Backup your data
tar -czf n8n-backup-$(date +%Y%m%d).tar.gz n8n_data/What's Next?
In Part 2, we'll dive into core workflow patterns — webhooks that receive data from external services, advanced scheduling, conditional logic chains, looping, and error handling strategies that keep your automations resilient.
You'll learn the patterns that make n8n workflows production-ready instead of fragile demos.
