Install Portainer BE with Docker on WSL / Docker Desktop
Portainer consists of two elements, the Portainer Server, and the Portainer Agent. Both elements run as lightweight Docker containers on a Docker engine. This document will help you install the Portainer Server container on your Windows environment with WSL and Docker Desktop. To add a new WSL / Docker Desktop environment to an existing Portainer Server installation, please refer to the Portainer Agent installation instructions.
To get started, you will need:
- The latest version of Docker Desktop installed and working.
- Administrator access on the machine that will host your Portainer Server instance.
- Windows Subsystem for Linux (WSL) installed and a Linux distribution selected. For a new installation we recommend WSL2.
- By default, Portainer Server will expose the UI over port
9443and expose a TCP tunnel server over port
8000. The latter is optional and is only required if you plan to use the Edge compute features with Edge agents.
- A license key for Portainer Business Edition.
The installation instructions also make the following assumptions about your environment:
- You are accessing Docker via Unix sockets. Alternatively, you can also connect via TCP.
- SELinux is disabled within the Linux distribution used by WSL. If you require SELinux, you will need to pass the
--privilegedflag to Docker when deploying Portainer.
- Docker is running as root. Portainer with rootless Docker has some limitations, and requires additional configuration.
First, create the volume that Portainer Server will use to store its database:
docker volume create portainer_data
Then, download and install the Portainer Server container:
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ee:latest
If you require HTTP port
9000open for legacy reasons, add the following to your
Portainer Server has now been installed. You can check to see whether the Portainer Server container has started by running
root@server:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f4ab79732007 portainer/portainer-ee:latest "/portainer" 2 weeks ago Up 29 hours 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp, 0.0.0.0:9443->9000/tcp, :::9443->9443/tcp portainer
Now that the installation is complete, you can log into your Portainer Server instance by opening a web browser and going to:
localhostwith the relevant IP address or FQDN if needed, and adjust the port if you changed it earlier.
You will be presented with the initial setup page for Portainer Server.