↑ ↓ select, Enter open, Esc close

Show the environment variables of a Docker container

Adjust the values, the command updates live
root@server
docker exec app env

Runs env in the running container and shows the variables as the application actually sees them, including those from environment: or .env of a Compose file. Useful when an application starts with default values despite a variable being set.

Note: The output often contains passwords and API keys, so do not paste it into tickets or chats without checking. Only works with running containers whose image includes env.

Also searched as

  • docker show environment variables
  • check env vars in running container
  • docker exec env

Related one-liners

All in Docker

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.