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.
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:
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
Build the image:
bash
docker build -t n8n-curl .
Update your docker-compose.yml to use this image:
yaml
services:
n8n:
image: n8n-curl
# ...rest of your config...
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.
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!