Portainer is a tool that simplifies the management and maintenance of Docker’s containers. A simple setup to deploy Portainer using docker compose
.
- Install Docker
- Install Docker Compose
Run:
git clone git@github.com:tanhongit/portainer-docker.git
cd portainer-docker
cp .env.example .env
Change APP_NAME and APP_PORT accordingly
Or using default values:
APP_NAME=portainer
APP_PORT=9001
Run:
docker compose up -d
Run:
docker ps
Check the Container ID of APP_NAME
-docker.
Run the command:
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <container ID>
<container ID>
: Use the Container ID of APP_NAME
-docker
You will get the IP address of this Container.
You can then access Portainer by using the IP address that you got it in step 4 over port 9000 with a web browser.
Example:
If the IP address is 172.18.0.2
, you can access Portainer by using the URL http://172.18.0.2:9000
.