404 page not found clean installation

After installing n8n following the docker compose server installation guide, I get a 404 page not found error when accessing the IP address of the machine. I’m hosting it in a AWS EC2 instance running Amazon Linux 2023. The docker-compose.yml and .env files are exactly like in the guide.

I’ve already read some topics below and tried all solutions, with no success.

n8n version is the default that comes with the above mentioned installation guide, and runs with the default database.

I’m running these commands as root user to setup all things and start the service:

# Everything below is run as root user in the instance startup

# Update dependencies
yum -y update

# Install docker
yum -y install docker

# Add group membership for the default ec2-user so you can run
# all docker commands without using the sudo command
usermod -a -G docker ec2-user
id ec2-user

# Reload a user's group assignments to docker w/o logout
# newgrp docker

# Enable docker service at AMI boot
systemctl enable docker.service

# Start docker service
systemctl start docker.service

# Install docker compose
curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

# Create n8n docker-compose.yml file
curl -L "https://gist.githubusercontent.com/giacomocolonetti/e062bbf1989e8ebf8c88f239af0004ce/raw/84dddf072ad77212df09a6b4ceeb2eb2719f56f2/docker-compose.yml" > docker-compose.yml

# Create n8n environment file
curl -L "https://gist.githubusercontent.com/giacomocolonetti/9b6bff282b01e6157f5b17c2c1ee37ec/raw/ff96acfcacda7c859769c24ac0f1a6114f0749fc/.env" > .env

# Create n8n volumes
docker volume create n8n_data
docker volume create traefik_data

# Start n8n
docker-compose up -d

Docker logs seems fine:

2023-11-28T23:37:44.415Z | info     | Initializing n8n process "{ file: 'start.js', function: 'init' }"
2023-11-28T23:37:44.850Z | debug    | Lazy Loading credentials and nodes from n8n-nodes-base "{\n  credentials: 351,\n  nodes: 429,\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
n8n ready on, port 5678
2023-11-28T23:37:45.953Z | debug    | [license] initializing for deviceFingerprint fdccea2663eb9a35094a83f0137e11666cbbb57e27ffa7c280cebbccc46e4259 "{ file: 'LicenseManager.js', function: 'log' }"
2023-11-28T23:37:45.974Z | debug    | [license] attempting license renewal "{ file: 'LicenseManager.js', function: 'log' }"
2023-11-28T23:37:45.979Z | debug    | Orchestration init complete "{ file: 'start.js', function: 'init' }"
2023-11-28T23:37:45.985Z | debug    | Binary data service init complete "{ file: 'start.js', function: 'init' }"
2023-11-28T23:37:45.986Z | debug    | External hooks init complete "{ file: 'start.js', function: 'init' }"
2023-11-28T23:37:45.988Z | debug    | External secrets init complete "{ file: 'start.js', function: 'init' }"
2023-11-28T23:37:45.989Z | debug    | Workflow history init complete "{ file: 'start.js', function: 'init' }"
2023-11-28T23:37:46.894Z | debug    | Wait tracker querying database for waiting executions "{ file: 'WaitTracker.js', function: 'getWaitingExecutions' }"
2023-11-28T23:37:50.277Z | debug    | Initializing event bus... "{ file: 'MessageEventBus.js', function: 'initialize' }"
2023-11-28T23:37:50.330Z | debug    | Initializing event writer "{ file: 'MessageEventBus.js', function: 'initialize' }"
2023-11-28T23:37:50.337Z | debug    | Checking for unsent event messages "{ file: 'MessageEventBus.js', function: 'initialize' }"
2023-11-28T23:37:50.346Z | debug    | Start logging into /home/node/.n8n/n8nEventLog.log  "{ file: 'MessageEventBus.js', function: 'initialize' }"
2023-11-28T23:37:50.348Z | debug    | MessageEventBus initialized "{ file: 'MessageEventBus.js', function: 'initialize' }"
Version: 1.17.1
2023-11-28T23:37:50.369Z | debug    | Server ID: main-yfQ7x3Smfn9jMuXT "{ file: 'Server.js', function: 'start' }"
2023-11-28T23:37:50.371Z | debug    | Setting soft-deletion interval at every 60.00 min (pruning cycle) "{ file: 'pruning.service.js', function: 'setSoftDeletionInterval' }"
2023-11-28T23:37:50.372Z | debug    | Scheduling hard-deletion for next 15.00 min (pruning cycle) "{ file: 'pruning.service.js', function: 'scheduleHardDeletion' }"
2023-11-28T23:37:50.382Z [Rudder] debug: in flush
2023-11-28T23:37:50.383Z [Rudder] debug: batch size is 1
2023-11-28T23:37:50.385Z [Rudder] debug: no existing flush timer, creating new one

Editor is now accessible via:
  • n8n version: latest
  • Database (default: SQLite): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: Amazon Linux 2023

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Looks like it’s related to the server deployment. When using the non-server setup it runs like a charm.

Hey @giacomo,

My guess would have been a DNS configuration issue although you have cloudflare in front of the domain so I would probably have disabled the proxy option on the subdomain option to see if that helped.

I also couldn’t see any of the traefik logs in your docker output to see if it grabbed the certificate ok but it sounds like you have managed to get it working now

Hi @Jon, thanks for replying!

It looks like Traefik is indeed having problems obtaining the certificate:

traefik-1  | time="2023-11-29T11:47:54Z" level=info msg="Configuration loaded from flags."
traefik-1  | time="2023-11-29T11:47:55Z" level=error msg="Unable to obtain ACME certificate for domains \"n8n.giacomocolonetti.com\": unable to generate a certificate for the domains [n8n.giacomocolonetti.com]: acme: error: 429 :: POST :: https://acme-v02.api.letsencrypt.org/acme/new-order :: urn:ietf:params:acme:error:rateLimited :: Error creating new order :: too many failed authorizations recently: see https://letsencrypt.org/docs/failed-validation-limit/" ACME CA="https://acme-v02.api.letsencrypt.org/directory" routerName=n8n@docker rule="Host(`n8n.giacomocolonetti.com`)" providerName=mytlschallenge.acme

As you suggested, disabling Cloudflare’s proxy managed to get it running. Nice!

1 Like

Hey @giacomo,

That is good to hear thanks for letting me know :slight_smile:

1 Like

This topic was automatically closed 7 hours after the last reply. New replies are no longer allowed.