When attempting to utilize the curl within execute command, I’m receiving an error that curl is not recognized. I am having difficulty to incorporate curl into make it accessible. I have already tried to include curl by adding it to dockerfile by apt-get but it is returning that apt-get can not be recognized. I tried by apk add but this one is also throwing me back the error apk not found.
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
The n8n Docker image is based on Alpine Linux, not Debian/Ubuntu, so apt-get won’t exist. apk is the right package manager but it needs root. The n8n container runs as the node user by default, which is why apk add fails too.
Two options:
Option 1: Install curl in your Dockerfile
FROM n8nio/n8n:latest
USER root
RUN apk add --no-cache curl
USER node
The key is switching to USER root before the install, then back to node.
Option 2 (recommended): Skip curl entirely
Use the HTTP Request node instead of the Execute Command node. It does everything curl does but natively inside n8n, with better error handling, built-in auth, and no shell dependency. Unless you have a very specific reason to need curl, this is the cleaner path.
Hi @ShawnWilliams! I want to update and correct my earlier reply with more accurate information, especially for recent n8n versions.
Why your attempts failed:
apt-get doesn’t exist — n8n’s Docker image is based on Alpine Linux, which uses apk instead of apt-get.
apk not found — Starting from n8n v2.1.0, the image was security-hardened and apk itself was removed from the image. So even USER root + apk add will fail on modern n8n images.
Solutions:
Option 1 (Recommended): Use the HTTP Request node
In most cases, you don’t actually need curl at all. The built-in HTTP Request node handles GET/POST requests, custom headers, authentication, and more — natively inside n8n without any shell dependency.
Since apk is removed from modern images, you first need to copy it in from a fresh Alpine image:
FROM alpine:latest AS alpine
FROM docker.n8n.io/n8nio/n8n:latest
COPY --from=alpine /sbin/apk /sbin/apk
COPY --from=alpine /usr/lib/libapk.so* /usr/lib/
USER root
RUN apk add --no-cache curl
USER node
```
**Option 3: Build a custom Docker image (older n8n, pre-v2.1.0)**
On older versions where `apk` was still present in the image:
```
FROM n8nio/n8n
USER root
RUN apk add --no-cache curl
USER node
```
**Correction from my earlier reply:** I previously said `wget` is available by default — that was wrong. `wget` is also not pre-installed and requires the same approach as `curl` above.
Hope this helps!
@ShawnWilliams just skip curl entirely and use the HTTP Request node, it does everything curl does natively without messing with your Docker image at all — the Execute Command node is overkill for HTTP calls.
swap the url to whatever you were curling, add auth under the HTTP Request node’s authentication section if you need headers/tokens.