Check Your Public IP Address with curl

One-liner to print the outbound public IPv4 address of your router or VPN from the command line.

LinuxcurlnetworkcliLow risk
Run curl -s https://api.ipify.org to print your public IP; use curl -s https://api64.ipify.org if you want to test IPv6 as well.

01Command

Command
$ curl -s https://api.ipify.org

02What it does

The -s flag silences curl's progress meter so only the address itself is printed, which is ideal in scripts and shell prompts. ipify is a lightweight echo service that simply returns the IP the request arrived from, so what you see is exactly the address websites and servers will associate with your traffic. If the value changes between runs, your ISP uses dynamic addresses or your VPN is rotating exits.

03Risk

RiskLow risk
Requirementscurl; internet access
!Warning: This reveals your public IP in the provider's server logs — that is inherent to any IP echo service; nothing is sent beyond the HTTP request itself.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • curl(1) — Ubuntu man page
    Ubuntu manpages · community · 2026-09-17
    Evidence: Man page text contains -s (silent mode) and -o (write output to file) option descriptions, confirming the flags used in the command.
  • curl(1) — Linux man page
    man7.org · community · 2026-09-17
    Evidence: Documents '-s/--silent' (silent or quiet mode, don't show progress meter) and '-o/--output'; confirms the '-s' flag text on the page.

Last verified: 2026-09-19 · Category: Network

06Related solutions