HostingB2B » How to » VPS Hosting » Fixing “Ping Command Not Found” Error in Ubuntu and Debian

Fixing “Ping Command Not Found” Error in Ubuntu and Debian

Summarize with:
Summarize with AI
Share:

Seeing “ping command not found” on a fresh server is frustrating. Minimal images on a HostingB2B VPS ship without network tools to keep the footprint small. Fortunately, the fix takes one command. In this guide, you will install the official iputils-ping package on Ubuntu, Debian, Rocky Linux, Alpine and Docker and verify it.

What Is the “Ping Command Not Found” Error?

The “linux ping command not found” error, often shortened to “ping not found”, means your shell cannot locate the ping binary. Typically, Bash prints “bash: ping: command not found” or “-bash: ping: command not found” after an SSH login. In other words, the tool is missing or sits outside your PATH.

Quick Fix: apt install iputils-ping

For a quick ubuntu install ping fix, run:

Related ReadHow to Host an LLM on a GPU VPS: Step-by-Step Guide (2026)
sudo apt update
sudo apt install iputils-ping -y

Next, test the result with ping -c 4 8.8.8.8.

Why “bash: ping: command not found” Happens

Ubuntu Server minimal, Debian cloud images and most Docker base images leave out iputils-ping by default. Consequently, the package manager never installs it. Additionally, vendors drop raw socket tools to shrink the attack surface. However, a broken PATH can also hide an installed binary.

Install Ping by Distribution

Install Ping on Ubuntu (all versions)

To fix “ubuntu ping command not found”, use the same package from 18.04 to 24.04:

sudo apt update && sudo apt install iputils-ping -y

Therefore, this also fixes “ubuntu server ping command not found”.

Install Ping on Debian

For a Debian install ping task, use the identical package. First, switch to root with su -, because minimal Debian often lacks sudo. Then run:

apt update && apt install iputils-ping -y

Likewise, the same steps apply on any Debian VPS running Debian 11, 12 or 13.

Install Ping on CentOS, Rocky and AlmaLinux

On RHEL-based systems, install the iputils package:

sudo dnf install iputils -y

For older CentOS 7 servers, use yum instead of dnf.

Install Ping on Alpine Linux and inside Docker

Alpine ships a BusyBox ping; for the full version, run apk add iputils-ping. Inside Debian or Ubuntu containers, add this Dockerfile line instead:

RUN apt-get update && apt-get install -y --no-install-recommends iputils-ping && rm -rf /var/lib/apt/lists/*

As a result, every rebuilt image keeps the tool.

HostingB2B Linux VPS
Minimal images keep the attack surface small, but you still want full root to add the tools you need. Ubuntu, Debian, AlmaLinux and Rocky Linux all deploy as standard images with a dedicated IP and instant activation.
See Linux VPS plans

Fix “ping: command not found” for Non Root Users (PATH issue)

Sometimes ping fails only for regular users. First, locate the binary with ls -l /usr/bin/ping. Next, check your PATH with echo $PATH. If /usr/bin is absent, add it back:

export PATH=$PATH:/usr/bin:/bin

Then, add that line to ~/.bashrc. Also, if you see “Operation not permitted”, restore the raw socket capability:

sudo setcap cap_net_raw+ep /usr/bin/ping

How to Verify Ping Is Installed

Finally, after you install ping, Ubuntu and Debian users can confirm it with three checks:

which ping
ping -V
ping -c 4 1.1.1.1

For every flag and option, see the ping(8) manual page.

Comparison Table

DistributionPackageInstall Command
Ubuntuiputils-pingsudo apt install iputils-ping
Debianiputils-pingapt install iputils-ping
CentOS, Rocky, AlmaLinuxiputilssudo dnf install iputils
Alpine Linuxiputils-pingapk add iputils-ping
Docker (Debian/Ubuntu base)iputils-pingRUN apt-get install -y iputils-ping

Common Use Cases by Industry

  • iGaming: Operators ping payment and game aggregator endpoints before peak traffic.
  • Fintech: Teams test banking APIs and failover sites during incident drills.
  • SaaS: Engineers check connectivity inside Docker and Kubernetes clusters.

Enterprise Deployment Considerations

  • Bake iputils-ping into golden images with Ansible, cloud-init or Packer.
  • Allow ICMP only from trusted ranges.
  • Monitor latency with Zabbix or Prometheus Blackbox Exporter.
  • Add this fix to incident response runbooks, and keep tested backups and redundant network paths.

FAQ

Why is ping missing on Ubuntu?

Minimal and cloud images exclude iputils-ping to save space.

Which package does apt install ping need?

Use iputils-ping. Because ping is a virtual package, apt asks you to choose a provider instead.

Does this fix work inside Docker?

Yes. Add the install line to your Dockerfile, then rebuild the image.

Why does ping work as root but not as a user?

Usually, a broken PATH or missing cap_net_raw capability causes this.

Is it safe to install ping on a production server?

Yes, in most cases. However, control ICMP exposure with firewall rules.

Low-latency Linux VPS

Deploy in Dubai, Cyprus or five other regions

Ubuntu, Debian, AlmaLinux and Rocky Linux images with full root access, a dedicated IP and instant activation, on Tier-III facilities with premium upstream carriers. From €19.90/month — and you can test our routing from your own network first.

Conclusion

In short, “ping command not found” means iputils-ping is missing or sits outside your PATH. So, install the right package, verify it, and bake it into your images. That way, your team keeps this basic diagnostic tool ready.

© 2026 All Rights Reserved. HostingB2B

Hosting B2B LTD is a Company registered in Cyprus with Company number HE410139 and VAT CY10410139C

Contact Info

© 2026 All Rights Reserved. HostingB2B