Coworking concept vector illustration.
Image: Visual Generation/Adobe Stock

Portainer is, hands down, my favorite container management GUI tool. With Portainer, you can manage every single aspect of your container development lifecycle and do so with ease. Portainer makes collaboration on container deployment work with just about any sized team.

Within the realm of collaboration, one way Portainer stands out is its ability to create different environments within the GUI that you can then give specific users access to. For example, you can assign developers access to the local environment and then create a production environment that links to a remote server and assign that to those who are in charge of container deployment. With such a setup, your deployment admins could copy the work from the developers into the production environment and deploy it.

But how do you pull off giving specific users access to specific environments? Let me show you.

SEE: Hiring kit: Back-end Developer (TechRepublic Premium)

What you’ll need

To make this work, you’ll need a running instance of Portainer and an admin user login credentials. That’s it, let’s get to work.

How to create an environment

The first thing we’re going to do is create a new environment that you can then assign to users. To create an environment, log into Portainer and click the Environments entry in the left sidebar (Figure A).

Figure A

Image: Jack Wallen/TechRepublic. The Environments entry is in the Portainer left sidebar.

In the resulting window (Figure B), click Add Environment.

Figure B

Image: Jack Wallen/TechRepublic. I already have four environments created, so what’s one more?

In the Environments Add window (Figure C), I’m going to go with Docker and then fill out the necessary information for my new environment (which will be a remote Docker server).

Figure C

Image: Jack Wallen/TechRepublic. Creating a new Environment in Docker.

Give the new environment a name, click the ON/OFF slider for Docker Socket, and then add the address (such as in the Public IP section. Click Add Environment to save.

How to assign users to an environment

Now that you’ve created the environment, let’s assign users to it. You will need to have created one or more teams (which is outlined in my article How to create teams in the Portainer container manager). Once you’ve created a team and added users to it, go to the Environments listing and click the new environment you just created. In the resulting window (Figure D), click Manage Access associated with the new environment.

Figure D

Image: Jack Wallen/TechRepublic. Docker Node 2 has been successfully added as a new environment.

In the Manage Access window (Figure E), select the team you want to be added to the environment and then click Create Access.

Figure E

Image: Jack Wallen/TechRepublic. Giving a team of users access to our new environment.

In the free version of Portainer, you cannot manage the roles associated with the team. If you opt to pay for the Business version, you can assign the following roles:

  • Environment
  • Operator
  • Help Desk
  • Read Only
  • Standard

Once you’ve created access to the environment, have a user that is a part of the assigned team login and they should be able to work with the new environment (Figure F).

Figure F

Image: Jack Wallen/TechRepublic. User Olivia, who’s a part of team DEV 1, has access to the new environment.

Congratulations, you’ve just given specific users access to a new Portainer Environment, where they can start building or deploying your containerized applications and services.

Learn more about security in Docker containers with this Hacking and Securing Docker Containers course in the TechRepublic Academy.

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.