Tekst is afkomstig van de websites:
https://clouding.io/hc/en-us/articles/360010398219-Install-Portainer-on-Ubuntu-18-04 en
https://linuxhint.com/install_portainer_docker_ui_ubuntu
First, it is recommended to update your system to the latest stable version. You can do it by running the following command:
sudo apt-get update -y
sudo apt-get upgrade -y
Install Docker
Next, you will need to install Docker CE on your server. By default, the latest version of Docker is not available in the Ubuntu 18.04 server default repository. So, you will need to add the repository for that:
First, download and add Docker CE GPG key with the following command:
sudo wget https://download.docker.com/linux/ubuntu/gpg
sudo apt-key add gpg
Next, add the Docker CE repository to APT with the following command:
sudo vim /etc/apt/sources.list.d/docker.list
Add the following line:
deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
Save and close the file, when you are finished. Then, update the repository with the following command:
apt-get update -y
Once the repository is updated, install Docker CE with the following command:
sudo apt-get install docker-ce -y
After installing Docker CE, check the Docker service with the following command:
sudo systemctl status docker
You should see the following output:
docker.service – Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2019-05-30 12:15:47 UTC; 25min ago Docs: https://docs.docker.com Main PID: 820 (dockerd) Tasks: 16 CGroup: /system.slice/docker.service ├─ 820 /usr/bin/dockerd -H fd:// –containerd=/run/containerd/containerd.sock └─2344 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 9000 -container-ip 172.17.0.2 -container-port 9000 May 30 12:23:15 ubuntu1804 dockerd[820]: time=”2019-05-30T12:23:15.217067700Z” level=info msg=”Ignoring extra error returned from registry: una |
Install Portainer
Docker is now installed and running, it’s time to install Portainer. First, download the Portainer image from Docker Hub with the following command:
sudo docker pull portainer/portainer
Once the Portainer image downloaded, you should see the following output:
Using default tag: latest latest: Pulling from portainer/portainer d1e017099d17: Pull complete 0b1e707a06d2: Pull complete Digest: sha256:d6cc2c20c0af38d8d557ab994c419c799a10fe825e4aa57fea2e2e507a13747d Status: Downloaded newer image for portainer/portainer:latest |
Once the download has been completed, create Portainer data directory with the following command:
sudo mkdir /opt/portainer /data
Next, run the Portainer container with the following command:
sudo docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
You can see the Portainer image with the following command:
sudo docker images
You should see the following output:
REPOSITORY TAG IMAGE ID CREATED SIZE portainer/portainer latest 19d07168491a 2 months ago 74.1MB |
You can check the running container with the following command:
sudo docker ps
You should see the following output:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 8d0c002fda93 portainer/portainer “/portainer” 5 seconds ago Up 3 seconds 0.0.0.0:9000->9000/tcp confident_leavitt |
Access Portainer Web Interface
Portainer container is now installed and running on port 9000. It’s time to access Portainer web interface. Now, open your web browser and type the URL http://**.**.**.**:9000 (Of http://domeinnaam:9000 / Localhost:9000). You will be redirected to the Portainer web interface as show below:
Hoe je Portainer upgrade naar versie 2.0 wordt hier uitgelegd:
Maar je kunt voor een upgrade ook deze commando’s uitvoeren (getest en werkend):
docker stop portainer
docker rm portainer
Those 2 commands will stop and remove the container respectively. Doing this will NOT remove your other applications/containers/etc.Now that you have stopped and removed the old version of Portainer, you can run this command
docker run -d -p 8000:8000 -p 9000:9000 –name=portainer –restart=always –pull=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
Voor verdere instructies hoe Portainer gebruikt kan worden om een container toe te voegen kijk hier:
https://linuxhint.com/install_portainer_docker_ui_ubuntu