Installation error

I am doing on Ubuntu as root user any help please

${DATA_FOLDER}/.n8n:/home/node/.n8n
[email protected]:~# sudo docker-compose up -d
ERROR: yaml.scanner.ScannerError: while scanning a simple key
in “./docker-compose.yml”, line 24, column 17
could not find expected ‘:’
in “./docker-compose.yml”, line 26, column 17
[email protected]:~#

Hey @chandan988, this sounds like docker compose didn’t understand your docker compose file. Is there a chance you have any unsupported or missing characters, missing indentation and the likes in there? You can find a simple example of a valid docker compose file here. A slightly more complex example also including a web server would be here in our documentation.

ERROR: yaml.parser.ParserError: while parsing a block mapping
in “./docker-compose.yml”, line 1, column 1
expected , but found ‘’
in “./docker-compose.yml”, line 4, column 9

Hey @chandan988, could you share your docker-compose.yml file so we can take a look at what might be wrong with it?

version: "3"

services:
  traefik:
    image: "traefik"
    restart: always
    command:
      - "--api=true"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.web.http.redirections.entryPoint.to=websecure"
      - "--entrypoints.web.http.redirections.entrypoint.scheme=https"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true"
      - "--certificatesresolvers.mytlschallenge.acme.email=${SSL_EMAIL}"
      - "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json"
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ${DATA_FOLDER}/letsencrypt:/letsencrypt
      - /var/run/docker.sock:/var/run/docker.sock:ro

  n8n:
    image: n8nio/n8n
    restart: always
    ports:
      - "127.0.0.1:5678:5678"
    labels:
      - traefik.enable=true
      - traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`)
      - traefik.http.routers.n8n.tls=true
      - traefik.http.routers.n8n.entrypoints=web,websecure
      - traefik.http.routers.n8n.tls.certresolver=mytlschallenge
      - traefik.http.middlewares.n8n.headers.SSLRedirect=true
      - traefik.http.middlewares.n8n.headers.STSSeconds=315360000
      - traefik.http.middlewares.n8n.headers.browserXSSFilter=true
      - traefik.http.middlewares.n8n.headers.contentTypeNosniff=true
      - traefik.http.middlewares.n8n.headers.forceSTSHeader=true
      - traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME}
      - traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true
      - traefik.http.middlewares.n8n.headers.STSPreload=true
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER
      - N8N_BASIC_AUTH_PASSWORD
      - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
    volumes:
      - ${DATA_FOLDER}/.n8n:/home/node/.n8n

i pasted exactly same Please see the screen recording also Screencastify

[email protected]:~# sudo docker-compose up -d
WARNING: Python-dotenv could not parse statement starting at line 1
ERROR: yaml.parser.ParserError: while parsing a block mapping
in “./docker-compose.yml”, line 5, column 23
expected , but found ‘’
in “./docker-compose.yml”, line 6, column 27

Hey @chandan988,

Looking at the video the first thing I noticed was when you copied the .env file content it didn’t appear to comment out the first line and the # was missing. Can you add that in and see if it changes anything, Can you also tell me what version of Docker Compose you are running?

Still Same error

[email protected]:~# sudo docker-compose up -d
ERROR: yaml.parser.ParserError: while parsing a block mapping
in “./docker-compose.yml”, line 5, column 23
expected , but found ‘’
in “./docker-compose.yml”, line 6, column 27
[email protected]:~#

Hey @chandan988,

What about the version of Docker Compose? I ran the YAML you pasted through a validator and it comes up as valid. Is it possible that something went wrong when pasting the YAML?

As a test could you save the file locally and upload it using SFTP to your instance that would help rule out anything odd.