How to Host n8n for FREE on Oracle Cloud with Docker and HTTPS
Most businesses pay monthly fees for workflow automation hosting without realizing Oracle Cloud offers a powerful free tier perfect for n8n. This step-by-step guide shows how to deploy a production-ready n8n instance with Docker containers, Nginx reverse proxy, HTTPS encryption, and a free Cloudflare domain - all without spending a dime.
Oracle Cloud Instance Setup
Creating your free Oracle Cloud instance is the foundation for hosting n8n. Many users struggle with selecting the right instance type and configuring network settings properly. The free tier offers two options: the E2.1 micro with 1GB RAM for lightweight workflows, or the more powerful A1.flex ARM instance when available.
During setup, critical steps include selecting Ubuntu 22.04 as the OS image, downloading SSH keys for secure access, and configuring ingress rules for ports 22 (SSH), 80 (HTTP), 443 (HTTPS), and temporarily 5678 (n8n default port). A common mistake is forgetting to create swap memory on the 1GB RAM instances, which can cause stability issues with n8n.
Pro Tip: Always verify your instance's public IP connects properly via SSH before proceeding. Connection failures at this stage usually indicate incorrect security rule configurations in Oracle Cloud.
Docker Installation and Configuration
Docker simplifies n8n deployment by containerizing all dependencies. After updating Ubuntu, install Docker using the official repository for the latest stable version. Many tutorials miss the crucial step of creating a persistent storage volume for n8n's data - without this, your workflows would disappear if the container restarts.
The correct permissions for the Docker data directory must be set to the OPC user (Oracle's default), not Ubuntu. This subtle difference causes permission errors that prevent n8n from saving workflows persistently. Verify the ownership with ls -la /var/lib/docker/volumes before proceeding.
Running n8n in Docker Container
With Docker ready, launch the n8n container using the official image. The key parameters include mapping the persistent volume, setting the base URL for proper reverse proxy operation, and exposing port 5678 internally. At 4:32 in the video, you'll see the exact docker run command with all required flags.
After starting the container, verify it's running with docker ps and check the logs for any errors. The first startup may take several minutes on the free tier's limited resources. Once running, you should be able to access n8n locally at http://localhost:5678 - this confirms the container works before we expose it to the internet.
Free Domain and DNS Configuration
Cloudflare provides free domains perfect for testing, with the added benefit of their CDN and security features. Register your free domain and configure DNS records to point to your Oracle Cloud instance's public IP. The critical step here is updating the domain's nameservers to Cloudflare's - this often takes 5-10 minutes to propagate.
Use nslookup yourdomain.com to verify DNS resolution points to your instance IP. Without proper DNS configuration, you won't be able to obtain an SSL certificate in the next steps. Cloudflare's proxy feature should remain disabled initially to allow direct HTTP access for certificate validation.
Nginx Reverse Proxy Setup
Nginx acts as a secure gateway to your n8n instance, providing performance optimizations and protecting the Docker container from direct internet exposure. Install Nginx and create two configuration files - one temporary for HTTP (port 80) to obtain the SSL certificate, and the permanent HTTPS configuration.
The Nginx config must properly handle WebSocket connections that n8n uses for real-time updates. A common mistake is forgetting the proxy_set_header directives that pass the original host and protocol information to n8n. Without these, n8n may generate incorrect URLs in workflows.
HTTPS with Let's Encrypt
Certbot automates SSL certificate issuance and renewal from Let's Encrypt. The process requires temporary HTTP access on port 80 for domain validation. After obtaining the certificate, configure Nginx to redirect all HTTP traffic to HTTPS and use strong encryption protocols.
Set up a cron job to automatically renew certificates before expiration. Cloudflare's free plan includes universal SSL, but having your own certificate provides end-to-end encryption and better compatibility with n8n's webhook features. Test your HTTPS configuration with curl -I https://yourdomain.com to verify it returns HTTP 200.
Firewall and Security Hardening
With Nginx handling HTTPS traffic, remove the temporary port 5678 rule from Oracle Cloud's security list. This leaves only ports 22 (SSH), 80 (HTTP redirect), and 443 (HTTPS) exposed. Configure Ubuntu's UFW firewall to match these rules for defense in depth.
For production use, consider adding basic authentication at the Nginx level and restricting access by IP if possible. The video at 14:20 shows how to back up and restore firewall rules so they persist after reboots. These final steps transform your setup from a test environment to production-ready.
Security Note: Always close port 5678 after setup. Leaving n8n's default port exposed creates a significant security risk since it lacks built-in authentication in the community edition.
Watch the Full Tutorial
For visual learners, the complete video tutorial walks through each configuration step in real-time, including troubleshooting common issues like port conflicts and firewall blocks. At 8:45, you'll see how to diagnose and resolve connectivity problems that may occur during setup.
Key Takeaways
This guide demonstrates that powerful workflow automation doesn't require expensive hosting. Oracle Cloud's free tier, combined with Docker and Cloudflare, provides a robust platform for n8n that scales to handle real business processes.
In summary: You've learned to deploy n8n on Oracle Cloud with enterprise-grade security at zero cost, automate SSL certificate management, and configure proper networking for reliable access. This foundation supports everything from simple task automation to complex multi-service workflows.
Frequently Asked Questions
Common questions about this topic
You need an Oracle Cloud free tier account, a Cloudflare account for DNS management and SSL certificates, and basic familiarity with Linux command line.
The setup requires about 30 minutes of configuration time and uses common open-source tools like Docker and Nginx.
- Oracle Cloud free tier account
- Cloudflare account
- Basic Linux command line knowledge
Yes, Oracle Cloud's free tier provides enough resources for small to medium n8n workflows.
The E2.1 micro instance with 1GB RAM works for basic automation, while the A1.flex ARM instance (when available) can handle more intensive workflows within free tier limits.
- E2.1 micro: 1GB RAM for basic workflows
- A1.flex: Up to 4 cores for more intensive automation
- Both options include free network bandwidth
Docker simplifies deployment and ensures consistent operation across different environments.
It handles all dependencies automatically and allows easy updates or migration of your n8n instance without affecting the host system.
- Simplified dependency management
- Consistent runtime environment
- Easy updates and migration
You need to open port 22 for SSH access, port 80 for HTTP traffic (temporary for SSL certificate generation), and port 443 for HTTPS.
The default n8n port 5678 should only be open during initial setup and then closed for security once Nginx is configured.
- Port 22: SSH administration
- Port 80: Temporary HTTP access
- Port 443: Permanent HTTPS access
Cloudflare provides free DNS management, a free SSL certificate via Let's Encrypt, and acts as a reverse proxy to protect your n8n instance.
It also offers DDoS protection and performance optimizations that improve your n8n instance's reliability and speed.
- Free DNS management
- SSL certificate automation
- DDoS protection and performance caching
Regularly update Docker containers (n8n and Nginx), renew SSL certificates automatically via cron jobs, and monitor resource usage.
Oracle Cloud may require occasional instance restarts for maintenance, so consider implementing automated backups of your n8n workflows.
- Container updates
- Certificate renewals
- Resource monitoring
Yes, you can use any domain you own by configuring its DNS records in Cloudflare to point to your Oracle Cloud instance's IP address.
The SSL certificate process works the same way with custom domains, though you may need to verify domain ownership depending on your domain registrar.
- Works with any owned domain
- Same SSL certificate process
- May require additional verification
GrowwStacks can deploy and manage your n8n instance on Oracle Cloud with enterprise-grade security, automated backups, and high availability configurations.
Whether you need a simple n8n deployment or complex multi-server architecture, our team handles the technical implementation so you can focus on workflow creation.
- Enterprise-grade n8n deployments
- Automated backups and monitoring
- Free initial consultation
Ready to Deploy Your Free n8n Instance?
Manual setup works for testing, but production environments need reliability and security. GrowwStacks deploys enterprise-ready n8n instances with monitoring, backups, and scaling - often within one business day.