2021-08-07 12:37:23 +00:00
|
|
|
## Portainer (CE)
|
|
|
|
This example provides a base setup for using [Portainer](https://www.portainer.io/).
|
|
|
|
More details on how to customize the installation and the compose file can be found in [portainer documentation](https://documentation.portainer.io/).
|
|
|
|
|
|
|
|
### Demo
|
|
|
|
You can try out the public demo instance first: http://demo.portainer.io/
|
|
|
|
- username: admin
|
|
|
|
- password: tryportainer
|
|
|
|
|
|
|
|
Project structure:
|
|
|
|
```
|
|
|
|
.
|
2022-05-10 09:59:25 +00:00
|
|
|
├── compose.yaml
|
2021-08-07 12:37:23 +00:00
|
|
|
└── README.md
|
|
|
|
```
|
|
|
|
|
2022-05-10 09:59:25 +00:00
|
|
|
[_compose.yaml_](compose.yaml)
|
2021-08-07 12:37:23 +00:00
|
|
|
``` yaml
|
|
|
|
services:
|
|
|
|
portainer:
|
|
|
|
image: portainer/portainer-ce:alpine
|
|
|
|
```
|
|
|
|
|
2022-05-10 09:59:25 +00:00
|
|
|
## Deploy with docker compose
|
2021-08-07 12:37:23 +00:00
|
|
|
When deploying this setup, the web interface will be available on port 9000 (e.g. http://localhost:9000).
|
|
|
|
|
|
|
|
``` shell
|
2022-05-10 09:59:25 +00:00
|
|
|
$ docker compose up -d
|
2021-08-07 12:37:23 +00:00
|
|
|
Starting portainer ... done
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## Expected result
|
|
|
|
|
|
|
|
Check containers are running:
|
|
|
|
```
|
|
|
|
$ docker ps
|
|
|
|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
|
|
|
860311c00e62 portainer/portainer-ce:alpine "/portainer -H unix:…" 54 seconds ago Up 53 seconds 8000/tcp, 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp portainer
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
Navigate to `http://localhost:9000` in your web browser to access the portainer web interface and create an account.
|
|
|
|
|
|
|
|
|
|
|
|
Stop the containers with
|
|
|
|
``` shell
|
2022-05-10 09:59:25 +00:00
|
|
|
$ docker compose down
|
2021-08-07 12:37:23 +00:00
|
|
|
# To delete all data run:
|
2022-05-10 09:59:25 +00:00
|
|
|
$ docker compose down -v
|
2021-08-07 12:37:23 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Troubleshooting
|
|
|
|
- Select the correct image for your OS. You can take a look at the published tags at [DockerHub](https://hub.docker.com/r/portainer/portainer-ce/tags)
|
|
|
|
|
|
|
|
> e.g. currently, the latest tag is for Windows (amd64) and alpine for Linux (amd64, arm/v7)
|