Curl not found in Execute Command

Describe the problem/error/question

When trying to use curl in execute command it is coming up with an error saying curl is not found. I am unsure on how to add curl in to make it available as I have looked at adding through dockerfile using apt-get but it is saying apt-get cannot be found. I have tried using apk add but I am also getting the error apk not found.

What is the error message (if any)?

/bin/sh: curl: not found

Please share your workflow

Share the output returned by the last node

/bin/sh: curl: not found

Information on your n8n setup

  • n8n version: 2.6.3
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker compose
  • Operating system: Linux Ubuntu 22.04 LTS

Hi @Hopmister211

curl isn’t included in the standard n8n Docker image, so the Execute Command node can’t find it. You need to run n8n from a custom image that has curl installed.

Here's how to fix it:
  1. Create a Dockerfile next to your docker-compose.yml:

dockerfile

FROM docker.n8n.io/n8nio/n8n

USER root
RUN apk --update add curl
USER node
  1. Build the image:

bash

docker build -t n8n-curl .
  1. Update your docker-compose.yml to use this image:

yaml

services:
  n8n:
    image: n8n-curl
    # ...rest of your config...
  1. Recreate the container:

bash

docker compose down
docker compose up -d --build

After this, curl will be available and the Execute Command node should work. If you still see /bin/sh: curl: not found, exec into the container and run curl --version to confirm it’s installed.

I have created the dockerfile and called it n8n-curl with what was specified within the file:

FROM docker.n8n.io/n8nio/n8n

USER root
RUN apk --update add curl
USER node

But when building I initially got the error:

ERROR: failed to build: failed to solve: failed to read dockerfile: open Dockerfile: no such file or directory

So i ran docker build -t n8n-curl . -f n8n-curl and it started to build before hitting the below error again:

[+] Building 0.8s (5/5) FINISHED                                                                                                                                                                                                                                                                                                                           docker:default
 => [internal] load build definition from n8n-curl                                                                                                                                                                                                                                                                                                                   0.0s
 => => transferring dockerfile: 113B                                                                                                                                                                                                                                                                                                                                 0.0s
 => [internal] load metadata for docker.n8n.io/n8nio/n8n:latest                                                                                                                                                                                                                                                                                                      0.1s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                                                                                                    0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                                                                                                      0.0s
 => CACHED [1/2] FROM docker.n8n.io/n8nio/n8n:latest@sha256:a9beb0dcaa547f0742a322f497af72127338d6ab8f3697b3be44f8ab737726f2                                                                                                                                                                                                                                         0.1s
 => => resolve docker.n8n.io/n8nio/n8n:latest@sha256:a9beb0dcaa547f0742a322f497af72127338d6ab8f3697b3be44f8ab737726f2                                                                                                                                                                                                                                                0.1s
 => ERROR [2/2] RUN apk --update add curl                                                                                                                                                                                                                                                                                                                            0.4s
------                                                                                                                                                                                                                                                                                                                                                                    
 > [2/2] RUN apk --update add curl:
0.323 /bin/sh: apk: not found
------
n8n-curl:5
--------------------
   3 |     USER root
   4 |     
   5 | >>> RUN apk --update add curl
   6 |     
   7 |     USER node
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c apk --update add curl" did not complete successfully: exit code: 127

@Hopmister211

The error happens because the official n8n image isn’t Alpine-based , it’s Debian-based, so the apk command simply doesn’t exist in that container. That’s why the build fails with apk: not found.

The fix is to use the correct package manager and install curl as root during the build. Here’s a working Dockerfile:

dockerfile

FROM docker.n8n.io/n8nio/n8n:latest

USER root
RUN apt-get update \
 && apt-get install -y curl \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/*
USER node

After that, build the image (making sure to point to the correct file or rename it to Dockerfile) and start the container from this custom image. With that, curl will be available in the container and the Execute Command node will work normally.

Give it a shot and let me know if that sorts it out! :blush:

hi @Hopmister211

take a look here:

1 Like