Skip to content
Securely manage Docker, Swarm, Kubernetes and Podman clusters in the cloud, on-premise, and in the data center.
Secure app deployment and device management for your Industrial IoT, IoT and Edge devices.
Let Portainer's Managed Platform Services accelerate your containerization journey.
Manage all your Docker, Swarm, Kubernetes and Podman clusters from a single secure interface.
Portainer empowers Platform Engineering teams to deliver efficient, user-centric services.
Empower your business by adopting containerization the easy way with Portainer.
Deploy to and manage your fleet of remote devices centrally and securely.
Onboard, manage and deploy workloads across hundreds of devices securely with Portainer.
Deployment scenarios
Partner Solutions
blog-banner
Neil Cresswell, CEOFebruary 21, 20222 min read

Using ENV files in Stacks with Portainer

Note: The following only applies to Docker Standalone and does not work for Docker Swarm.

OK, so a little confession.. our documentation, whilst already pretty comprehensive, doesn't cover every single detail of Portainer features... why? Because we are still a startup, and its only in the last 12 months that we have had the ability to fund people to start to focus on our documentation... so there are times when things are just, well, not documented.

We were recently called out for a particular piece of functionality in Portainer that is not documented (it will be now), in regards to using ENV files when deploying Stacks with Portainer. As a way to first apologize to the reporter (and to thank you for highlighting the missing docs), and to start the process to get this documented, I figured a blog would make sense.. so here goes.

So, you have a compose/stack file that has a lot of environment variables, and you want to load these into Portainer via an ENV file, and then make these available to the stack as a file (negating the need to define each one manually). How do you do that?

Well there is a nifty little button in Portainer "load variables from env file", and if you click that button, and select a ENV file on your PC, we auto-populate Portainer with these variables.

avatar

Neil Cresswell, CEO

Neil brings more than twenty years’ experience in advanced technology including virtualization, storage and containerization.

COMMENTS

Related articles