> For the complete documentation index, see [llms.txt](https://docs.neevcloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.neevcloud.com/neevcloud-guide/neevcloud-knowledgebase/setup-n8n/production-deployment-of-n8n-workflow-automation-platform.md).

# Production deployment of n8n workflow automation platform

&#x20;**Overview**

This document provides a complete, production-ready installation and configuration guide for deploying **n8n** on **Ubuntu 22.04**, including:

* Docker-based installation
* Reverse proxy configuration using NGINX
* HTTPS enablement using Let’s Encrypt

The guide ensures a secure, stable, and scalable deployment suitable for enterprise use.

***

**System Requirements**

**Virtual Machine Specifications**

| Component        | Minimum Requirement | Recommended         |
| ---------------- | ------------------- | ------------------- |
| Operating System | Ubuntu 22.04 LTS    | –                   |
| CPU              | 2 vCPU              | 2–4 vCPU            |
| RAM              | 4 GB                | 4–8 GB              |
| Storage          | 20 GB               | 40–50 GB SSD        |
| Network          | Public IP Address   | Static IP Preferred |

**Required Ports**

| Purpose       | Port |
| ------------- | ---- |
| SSH           | 22   |
| n8n Web UI    | 5678 |
| HTTP (NGINX)  | 80   |
| HTTPS (NGINX) | 443  |

**Prerequisites**

Ensure the following before starting:

&#x20;A working Ubuntu 22.04 VM\
&#x20;Public IP reachable over the internet\
&#x20;Domain name pointing to the server

To verify domain DNS resolution:

```bash
nslookup yourdomain.com
```

***

**Step1: Install Docker & Docker Compose**

**1.1 Update System Packages**

```bash
sudo apt update && sudo apt upgrade -y
```

**1.2 Install Docker Engine**

```bash
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.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
```

**1.3 Install Docker Compose**

```bash
sudo apt install -y docker-compose
```

**1.4 Verification**

Check Docker service:

```bash
sudo systemctl status docker
```

Check versions:

```bash
docker --version
docker-compose --version
```

***

**Step2: Deploy n8n using Docker Compose**

**2.1 Create Directory**

```bash
mkdir ~/n8n-compose
cd ~/n8n-compose
```

**2.2 Create Docker Compose File**

```bash
sudo nano docker-compose.yml
```

**2.3 Add the Following Configuration**

```yaml
version: "3.3"

services:
  n8n:
    image: docker.n8n.io/n8nio/n8n
    restart: always
    ports:
      - "5678:5678"

    environment:
      - TZ=Asia/Kolkata
      - GENERIC_TIMEZONE=Asia/Kolkata

      # Basic Authentication
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=hello@123

      # Database
      - DB_TYPE=sqlite

      # Domain 
      - N8N_HOST=your-domain
      - N8N_PORT=5678
      - N8N_PROTOCOL=http

    volumes:
      - n8n_data:/home/node/.n8n

volumes:
  n8n_data:
```

**save the file in nano.**

* Press **CTRL + O** → then press **Enter** to save
* Press **CTRL + X** to exit nano

**2.4 Start n8n Service**

```bash
docker compose up -d
```

**2.5 Validate Service**

```bash
docker ps
```

***

**Step3: Access n8n Web Interface**

If domain is not configured:

```
http://<server-ip>:5678
```

If Basic Authentication is enabled:

* Username: admin
* Password: hello\@123

After login, set:

* Email
* First Name
* Last Name
* New admin password

This will create the **primary Owner Account**.

***

**Step4: Configure NGINX Reverse Proxy**

**4.1 Install NGINX**

```bash
sudo apt install nginx -y
```

**4.2 Create Reverse Proxy Configuration**

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

Paste:

```nginx
server {
    listen 80;
    server_name yourdomain.com;   #your_domain_name

    location / {
        proxy_pass http://127.0.0.1:5678/;
        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;
    }
}
```

**save the file in nano.**

* Press **CTRL + O** → then press **Enter** to save
* Press **CTRL + X** to exit nano

**4.3 Enable Configuration**

```bash
sudo ln -s /etc/nginx/sites-available/n8n /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
sudo systemctl status nginx
```

<figure><img src="/files/C34Sy6t6Ks93vw7RSlkb" alt=""><figcaption></figcaption></figure>

***

**Step5: Enable HTTPS using Let’s Encrypt**&#x20;

**5.1 Install Certbot**

```bash
sudo apt install certbot python3-certbot-nginx -y
```

**5.2 Generate SSL Certificate**

```bash
sudo certbot --nginx -d yourdomain.com
```

<figure><img src="/files/RAE2RkiUOQB3HCOgpCBY" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/CPxLvooaqN4lyObXbhhy" alt=""><figcaption></figcaption></figure>

Follow prompts:

* Enter email
* Accept Terms of Service: Yes
* Choose whether to share email
* Certbot applies SSL automatically

**5.3 Validate HTTPS**

Open:

```
https://yourdomain.com
```

Expected:

SSL padlock\
Secure connection\
n8n dashboard loads without port

**Step6: Deployment Completed Successfully**

> **n8n has been successfully installed on Ubuntu 22.04 with Docker, configured with NGINX Reverse Proxy, and secured with HTTPS using Let’s Encrypt.**

<figure><img src="/files/1qous2fW5zDNN7UV0fXq" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.neevcloud.com/neevcloud-guide/neevcloud-knowledgebase/setup-n8n/production-deployment-of-n8n-workflow-automation-platform.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
