n8n Installation & Configuration on Ubuntu 22.04
VM Configuration for n8n (Ubuntu 22.04)
OS
Ubuntu Server 22.04 LTS (64-bit)
CPU
Minimum 2 vCPU (Recommended: 2–4 cores)
RAM
Minimum 4 GB (Recommended: 4–8 GB)
Storage
Minimum 20 GB (Recommended: 40–50 GB SSD)
Network
Static/Private IP (Example: 172.83.83.77)
Required Ports
5678 (n8n UI), 22 (SSH), 80/443 (Optional for HTTPS)
Timezone
Asia/Kolkata (via system or environment)
Required Software
Docker Engine
Latest stable (≥20.x)
Docker Compose
Version 2.x or above
Git & Curl
Installed for basic system and Docker setup
Security & Firewall (if you want to enable ufw, optional):
sudo ufw allow 22 # SSH
sudo ufw allow 5678 # n8n Web Interface
sudo ufw allow 80,443 # Only if using HTTPS/Reverse Proxy
sudo ufw enableSteps for n8n Installation & Configuration:
1. Prepare Your Ubuntu 22.04 VM
Update your system:
2. Install Docker and Docker Compose Install Docker Engine:
Install Docker Compose:
Verify Docker & Docker Compose Installation
2.1: Check if Docker Service is Running
Expected Result:
Docker service should show active (running)
If it’s not running, start it using:

2.2: Verify Docker Version
Expected Result:
Displays the installed Docker version (e.g., Docker version 28.x.x)
2.3: Verify Docker Compose Version
For standalone Docker Compose:
Expected Result:
Shows the installed Docker Compose version.

2.4: Check Running Containers (Optional but Useful)
Expected Result:
Lists all currently running Docker containers .

Allow your user to run Docker without sudo:
3. Configure n8n with Docker Compose
Create a directory for n8n:
Create a docker-compose.yml file:
Paste the following configuration inside the file:
save the file in nano.
Press CTRL + O → then press Enter to save
Press CTRL + X to exit nano
Start n8n: This command starts n8n in the background using Docker Compose.

4. Optional (Only if UFW is active): Allow Port 5678
Before allowing the port, first check if UFW (firewall) is active:
If the status is active, then allow port 5678 for n8n:
If UFW is inactive, you can skip this step.
5. Access n8n:
Open your browser and go to http://<your_vm_ip>:5678 you will see one of the following screens, depending on settings:
Case 1: Basic Authentication Enabled (Your YAML file has this )
You will first see a popup like this:
Here you have to enter the credentials you added in the docker-compose.yml:
Username:
adminPassword:
hello@123
Case 2: n8n Setup Page (Owner Account Creation)
After entering Basic Auth credentials, you will see a screen asking:
Click "Next".
This creates your n8n Owner Account.

After Account Creation You’ll land on the n8n Main Dashboard (Workflow Editor).

From here, you can:
Create workflows
Add triggers (like Webhook, Cron, Gmail, Slack, etc.)
Automate tasks visually.
Last updated
Was this helpful?