3.3 KiB
3.3 KiB
layout | title | description | author | image | categories | pic01 | pic02 | pic03 | pic04 | pic05 | pic06 | pic07 | pic08 | pic09 | pic10 | pic11 | pic12 | pic13 | pic14 | pic15 | stack_example | comments | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
post | Portainer Stacks | Install Docker containers using docker-compose files with Portainer Stacks. | sthope | portainer-logo.png |
|
/assets/images/portainer_stacks/1.jpg | /assets/images/portainer_stacks/2.jpg | /assets/images/portainer_stacks/3.jpg | /assets/images/portainer_stacks/4.jpg | /assets/images/portainer_stacks/5.jpg | /assets/images/portainer_stacks/6.jpg | /assets/images/portainer_stacks/7.jpg | /assets/images/portainer_stacks/8.jpg | /assets/images/portainer_stacks/9.jpg | /assets/images/portainer_stacks/10.jpg | /assets/images/portainer_stacks/11.jpg | /assets/images/portainer_stacks/12.jpg | /assets/images/portainer_stacks/13.jpg | /assets/images/portainer_stacks/14.jpg | /assets/images/portainer_stacks/15.jpg | https://git.sthope.dev/sthope/docker_portainer_stacks/src/branch/master/libreoffice.yml | true |
Installling Portainer
There are a few ways of running docker containers, it should not matter which way your prefer most. Here are some examples
via Terminal, open the terminal and enter:
docker volume create portainer_data; \
docker run -d \
-p 8000:8000 \
-p 9000:9000 \
--name=portainer \
--restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
--labels com.centurylinklabs.watchtower.enable=true \
--network_mode=bridge \
portainer/portainer-ce:latest
via docker-compose.yml file Create `docker-compose.yml` file, eg: `nano ~/docker/docker-compose.yml` and paste:
---
version: "3.8"
services:
portainer:
container_name: "portainer"
image: "portainer/portainer-ce:latest"
restart: "always"
network_mode: "bridge"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "portainer_data:/data"
port:
- "8000:8000"
- "9000:9000"
labels:
- "com.centurylinklabs.watchtower.enable=true"
volumes:
portainer_data:
external: false
### Portainer WebUI
Portainer should now be available at: http://IP:9000.
- Configure
Username
andPassword
toCreate user
. - Select
Docker
andConnect
. - Click in
local
to access your instance. - Navigate to
Endpoints
on the left-side menu and click onlocal
to edit. - In
Public IP
put the IP address of Portainer. Bonus you can name it differently if you want. AfterPublic IP
configured pressUpdate Endpoint
. - Navigate to
Stacks
on the left-side menu. - Here you can paste most docker-compose.yml files or create your own.
- For example:
- Here you can upload Stacks directly from Github, Gitea and many others.
- Here is a example using this personal Gitea server.
- Stack running
- Inside the
Stack
- Updating/Editing the
Stack
locally. - Stack file can also be edited on Git and pushed again to assume the changes.