Installed n8n on virtual machine but when visiting domain nothing happens.

Ethan Fox 20 Reputation points
2024-06-08T00:54:51.46+00:00

I followed this tutorial to install n8n on a virtual machine in my azure account.

https://github.com/gogosoon/n8n-simple-installtion-with-ssl

I completed all of the steps successfully but when I go to the domain nothing happens. The request times out.

What else do I need to do? I had no problem with any of the steps. Do I need to do something with the certificate I downloaded to be able to visit the site?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,043 questions
0 comments No comments
{count} votes

Accepted answer
  1. Abiola Akinbade 29,490 Reputation points Volunteer Moderator
    2024-06-08T18:17:13.5866667+00:00

    Hello Ethan Fox,

    Thanks for your question.

    Based on the links you sent I will recommend the following according to the link you provided:

    • confirm these outbound ports are allowed on your vm: 80, 443 (for HTTPS), and 5678
    • Also confirm the status of your service

    sudo systemctl status n8n

    • Confirm DNS using any DNS checker
    • Use ufw to verify firewall settings.
    • If you verify the above then you will need to reach out to n8n support

    Regards,

    You can mark it 'Accept Answer' if this helped.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Nikhil Duserla 8,100 Reputation points Microsoft External Staff Moderator
    2024-06-10T09:54:08.42+00:00

    Hi @Ethan Fox,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    Apart from the answer provided by the community member akinbade abiola, we also suggest that you go through the following for better understanding.

    We've addressed your query, and it's functioning well on our end. We're securely accessing n8n. Please review the following steps:

    If this solves your question, please accept this answer so it helps others in the community too.As following with this link https://github.com/gogosoon/n8n-simple-installtion-with-ssl

    Installing docker with below commands:

    • sudo apt update
    • sudo snap install docker

    User's image

    Starting n8n in Docker

    • *sudo docker run -d --restart unless-stopped -it *
      *--name n8n \*
      
      *-p 5678:5678 \*
      
      *-e N8N_HOST="your-domain.com" \*
      
      *-e VUE_APP_URL_BASE_API="https://your-domain.com/" \*
      
      *-e WEBHOOK_TUNNEL_URL="https://your-domain.com/" \*
      
      *-v ~/.n8n:/root/.n8n \*
      
      *n8nio/n8n*
      

    Please replace your-domain.com with your actual domain. After this, you can access n8n on your-domain.com:5678

    User's image

    Installing nginx by running below command:

    • sudo apt install nginx

    Configuring nginx by using this command:

    • sudo vi /etc/nginx/sites-available/n8n

    Then, paste the following content:

    server {

    *listen 80;*
    
    *server_name your-domain.com;*
    
    *location / {*
    
        *proxy_pass http://localhost:5678;*
    
        *proxy_set_header Connection '';*
    
        *proxy_http_version 1.1;*
    
        *chunked_transfer_encoding off;*
    
        *proxy_buffering off;*
    
        *proxy_cache off;*
    
    *}*
    

    }

    Again, replace your-domain.com with your actual domain.

    User's image

    after that,

    After that, you can create a symbolic link of this file in the sites-enabled directory:

    • sudo ln -s /etc/nginx/sites-available/n8n /etc/nginx/sites-enabled/

    Run below commands:

    • sudo nginx -t
    • sudo systemctl restart nginx

    User's image

    You would also need to allow ports 80, 443 (for HTTPS), and 5678 (for n8n) in your NSG.

    User's image

    At this point, you should be able to access n8n on your-domain.com

    Please ensure that DNS records are added for the domain to correctly point to the IP address, including both A (IPv4 address) and AAAA (IPv6 address) records for the domain "your-domain.com" within the DNS (Domain Name System).

    Setting up SSL with Certbot

    First, install Certbot and the Nginx plugin by running:

    • sudo apt install certbot python3-certbot-nginx
    • sudo certbot --nginx -d your-domain.com

    Again, replace your-domain.com with your actual domain

    Final Output:

    User's image

    If this solves your question, please accept this answer so it helps others in the community too.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.