How To Install Envsubst?
envsubst
Install envsubst
-
Debian
apt-get install gettext-baseClick to copy -
Ubuntu
apt-get install gettext-baseClick to copy -
Alpine OS
apk add gettextClick to copy -
Arch Linux
pacman -S gettextClick to copy -
Kali Linux
apt-get install gettext-baseClick to copy -
CentOS
yum install gettextClick to copy -
Fedora
dnf install gettextClick to copy -
Raspbian
apt-get install gettext-baseClick to copy -
macOS
brew install gettextClick to copy
Substitutes shell format strings with environment variables in text. Strings to be replaced should be in either `${var}` or `$var` format.
How to use envsubst?
Below are few example commands for envsubst that you can use in the terminal.
Replace environment variables in stdin and output to stdout:echo '$HOME' | envsubstClick to copyReplace environment variables in an input file and output to stdout:envsubst < path/to/inputClick to copyReplace environment variables in an input file and output to a file:envsubst < path/to/input > path/to/outputClick to copyReplace environment variables in input from a space-separated list:envsubst variables < path/to/inputClick to copy
Installing envsubst command is simple. just copy one of the above commands for your operating system and paste it into terminal. This command is available for Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian and macOS operating systems. Once you run the command it will install the latest version of envsubst 2026 package in your OS.




