Install n8n on Oracle Free Tier
Note: This guide is based on and inspired by Self-hosted n8n with Oracle Cloud by @dcheng857 on Medium. Please check out the original article for more details and credit.
Setting up Oracle Cloud Free Tier and User
Before installing n8n, you need to set up your Oracle Cloud Free Tier account and create a VM instance:
1. Sign Up for Oracle Cloud Free Tier
- Go to Oracle Cloud Free Tier and sign up for a free account.
- Complete the registration process and verify your email and payment method (no charges for Free Tier usage).
2. Create a Virtual Machine (VM) Instance
- Log in to the Oracle Cloud Console.
- Navigate to Compute > Instances and click Create Instance.
- Enter a name for your instance.
- Choose the Always Free-eligible shape (e.g., “VM.Standard.E2.1.Micro”).
- Add your SSH public key (generate one with
ssh-keygen
if you don’t have one). - Click Create and wait for the instance to be provisioned.
2.1. Open Ingress Rules for Ports 80 and 443
To allow web traffic to your n8n instance, you need to open ports 80 (HTTP) and 443 (HTTPS) in your Oracle Cloud network settings:
- In the Oracle Cloud Console, go to Networking > Virtual Cloud Networks and select the VCN your instance is using.
- Click on the Subnet your instance is attached to.
- Under Security Lists, click the security list associated with your subnet.
- Click Add Ingress Rules and add two rules:
- Source CIDR: 0.0.0.0/0
- IP Protocol: TCP
- Destination Port Range: 80 (for HTTP)
- Repeat for port 443 (for HTTPS)
- Save the rules. Your instance will now accept incoming traffic on ports 80 and 443.
3. Connect to Your VM
- Find the public IP address of your instance in the Oracle Cloud Console.
- Connect via SSH:
1 |
|
- The default user is
opc
. You can create a new user if desired:
1 |
|
- (Optional) Copy your SSH key to the new user:
1 |
|
Setting up n8n with Docker, NGINX, and SSL on Ubuntu
This guide walks through setting up a production-ready n8n instance with Docker, NGINX as a reverse proxy, and SSL certificates using Let’s Encrypt. We’ll also configure some additional features like the Brave Search API integration.
Prerequisites
- Ubuntu 20.04 LTS server
- A domain pointed to your server (in this guide we use n8n.dannyshmueli.com)
- Basic command line knowledge
Step 1: Install Docker
First, let’s install Docker which we’ll use to run n8n:
1 |
|
Step 2: Install and Configure NGINX
Install NGINX to act as our reverse proxy:
1 |
|
Create an NGINX configuration file for n8n:
1 |
|
Enable the configuration:
1 |
|
Step 3: Configure Firewall
Allow HTTP and HTTPS traffic:
1 |
|
Step 4: Set Up SSL with Let’s Encrypt
Install Certbot and get SSL certificates:
1 |
|
Step 5: Run n8n with Docker
Now we’ll run n8n with proper configuration including authentication and webhook support:
1 |
|
Step 6: Additional Configuration - Brave Search API Integration
If you’re planning to use the Brave Search API with n8n, you can add the API key to the Docker configuration:
1 |
|
Maintenance and Troubleshooting
Viewing Logs
To check n8n logs:
1 |
|
Restarting n8n
To restart the n8n container:
1 |
|
Updating n8n
To update to the latest version:
1 |
|
Note: Replace the environment variables with your actual configuration values. If you’re using the Brave Search API integration, include the BRAVE_API_KEY
environment variable as well.
Security Considerations
- Always use strong passwords for n8n authentication
- Keep your system and Docker updated
- Regularly backup your ~/.n8n directory
- Use HTTPS only (configured through NGINX and Let’s Encrypt)
Common Issues and Solutions
Permission Issues
If you encounter permission issues with the n8n directory:
1 |
|
WebSocket Connection Issues
If you have issues with WebSocket connections, ensure your NGINX configuration includes the proper WebSocket headers (as shown in the NGINX configuration above).
Conclusion
You now have a production-ready n8n instance running with:
- HTTPS encryption
- Basic authentication
- Webhook support
- WebSocket support
- Automatic container restart
- Brave Search API integration
Remember to regularly backup your data and keep your system updated for security and stability.