You paste a one-line installer, and the shell answers with something like -bash: curl: command not found. Nothing is broken: on a minimal Linux image, curl simply is not installed. Cloud and container images ship as little as possible, and curl is one of the first things left out.
The fix is a single package install. Which command you need depends on the distribution — and if you are inside a container, on whether a package index exists at all.
First: which system are you on?
If you are not sure what you are logged into, ask the system rather than guessing. The package manager is what matters, not the marketing name.
cat /etc/os-release | head -2The ID line tells you the family: debian and ubuntu use apt, alpine uses apk, rocky, almalinux, rhel and fedora use dnf.
Installing curl
Debian and Ubuntu
Update the package index first. Without it, apt will often claim the package does not exist, which is the most common follow-up problem on fresh images.
sudo apt update
sudo apt install -y curlAlpine
Alpine is what most slim Docker images are built on. It uses apk, and --no-cache avoids leaving an index behind in the image layer.
apk add --no-cache curlRocky, AlmaLinux, RHEL and Fedora
sudo dnf install -y curl
# older releases still using yum
sudo yum install -y curlArch and openSUSE
# Arch
sudo pacman -S --noconfirm curl
# openSUSE
sudo zypper install -y curlInside a Docker container
Two things differ in a container: you are usually already root, so sudo does not exist, and the package index is empty because the image was built without it. Both explain why the commands above fail there.
apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*Do this in the Dockerfile rather than in a running container — anything you install interactively is gone the moment the container is recreated.
FROM debian:13-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*When curl is installed but still “not found”
Occasionally the package is present and the shell still refuses. There are three realistic causes.
- The shell cached the lookup. Bash remembers where commands live. After an install, run
hash -rto clear that table, or just open a new shell. - The binary is not on your PATH. Check with
ls -l /usr/bin/curl. If it exists there but the shell disagrees, printecho $PATHand look for a truncated or overwritten value in your.bashrcor.zshrc. - You are in a restricted environment. Some managed shells and minimal
scratchcontainers have no package manager at all. There the answer is to rebuild the image with curl baked in.
command -v curl # prints the full path, or nothing
curl --version # prints version and supported protocolsIf you cannot install anything
On a locked-down box you may not be allowed to add packages. Two substitutes cover most one-off downloads:
# wget is present on many images that lack curl
wget -qO- https://example.com
# bash can open a TCP socket on its own — no external tool needed
exec 3<>/dev/tcp/example.com/80
printf 'GET / HTTP/1.1\r\nHost: example.com\r\nConnection: close\r\n\r\n' >&3
cat <&3A note on fresh servers
If you meet this error on a brand-new VPS, it is worth spending the same five minutes on the rest of the base setup: a non-root user, key-only SSH and automatic security updates. Our images ship with curl present, so the first command you paste just works — see the Standard KVM line if you need a box to try this on.
Frequently asked
Why is curl missing when wget works?
They are separate packages. Minimal images frequently ship wget or neither — installing curl explicitly is normal and safe.
Do I need sudo to install curl?
On a normal user account yes. Inside most Docker containers you are already root, so run the package manager without sudo — the command usually does not exist there.
curl is installed but the shell still says command not found — why?
The binary is not on your PATH, or the shell cached an old lookup. Run 'hash -r', then check 'command -v curl' and inspect $PATH.