{"id":3385,"date":"2018-04-24T15:08:31","date_gmt":"2018-04-24T11:08:31","guid":{"rendered":"https:\/\/www.howtoforge.com\/tutorial\/ubuntu-docker-portainer\/"},"modified":"2018-04-24T15:08:31","modified_gmt":"2018-04-24T11:08:31","slug":"how-to-manage-docker-containers-using-portainer-on-ubuntu","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/how-to-manage-docker-containers-using-portainer-on-ubuntu\/","title":{"rendered":"How to Manage Docker Containers using Portainer on Ubuntu"},"content":{"rendered":"<p>Portainer is an open-source management UI for Docker, including Docker Swarm environment. Portainer makes it easier for you to manage your Docker containers, it allows you to manage containers, images, networks, and volumes from the web-based Portainer dashboard.<\/p>\n<p>In this tutorial, I will show you step-by-step how to install and configure Portainer on Ubuntu 16.04 LTS. We will install and configure Portainer, deploy the Apps Container, Manage Container, images, network, and volumes for our Docker environment.<\/p>\n<h2 id=\"prerequisites\">Prerequisites<\/h2>\n<ul>\n<li>Ubuntu Server 16.04<\/li>\n<li>Root privileges<\/li>\n<\/ul>\n<h2 id=\"what-we-will-do\">What we will do<\/h2>\n<ol>\n<li>Install Docker on Ubuntu 16.04<\/li>\n<li>Install and Configure Portainer<\/li>\n<li>Deploy Ghost Blog App Container<\/li>\n<li>Docker Environment Management<\/li>\n<\/ol>\n<h2 id=\"step-install-docker-on-ubuntu-lts\">Step 1 &#8211; Install Docker on Ubuntu 16.04 LTS<\/h2>\n<p>Before installing docker packages, please update the repository on your system and upgrade packages.<\/p>\n<p class=\"command\">sudo apt update<br \/>sudo apt upgrade<\/p>\n<p>Now install docker using the yum command below.<\/p>\n<p class=\"command\">sudo apt install docker.io -y<\/p>\n<p>After the installation is complete, start docker service and enable it to launch everytime at system boot.<\/p>\n<p class=\"command\">systemctl start docker<br \/>systemctl enable docker<\/p>\n<p>Docker installed on ubuntu 16.04 server, check it using the command below.<\/p>\n<p class=\"command\">docker version<\/p>\n<p>And you will get the docker version 1.x installed on the system.<\/p>\n<p><a class=\"fancybox\" id=\"img-1\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_manage_docker_container_using_portainer_on_ubuntu_1604\/big\/1.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu.png\" alt=\"Install Docker on Ubuntu\" width=\"500\" height=\"325\" title=\"\"><\/a><\/p>\n<h2 id=\"step-install-and-configure-portainer\">Step 2 &#8211; Install and Configure Portainer<\/h2>\n<p>Portainer can be installed as a docker container and standalone without docker container.<\/p>\n<p>In this tutorial, we will install Portainer as a Docker container. It&#8217;s really simple to install and run on any system because we just need to ensure the system support for Docker.<\/p>\n<p>Before installing Portainer, download the Portainer image from the DockerHub using the docker pull command below.<\/p>\n<p class=\"command\">docker pull portainer\/portainer<\/p>\n<p><a class=\"fancybox\" id=\"img-2\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_manage_docker_container_using_portainer_on_ubuntu_1604\/big\/2.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-1.png\" alt=\"Install Portainer\" width=\"500\" height=\"180\" title=\"\"><\/a><\/p>\n<p>Now run Portainer using the simple docker command below.<\/p>\n<p class=\"command\">docker run -d -p 9000:9000 -v \/var\/run\/docker.sock:\/var\/run\/docker.sock portainer\/portainer<\/p>\n<p>Portainer is now running as a container, check it using the docker ps command.<\/p>\n<p class=\"command\">docker ps<\/p>\n<p>And you will get the result as below.<\/p>\n<p><a class=\"fancybox\" id=\"img-3\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_manage_docker_container_using_portainer_on_ubuntu_1604\/big\/3.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-2.png\" alt=\"Docker ps result\" width=\"500\" height=\"97\" title=\"\"><\/a><\/p>\n<p>Portainer is now running as a Docker container with the name &#8216;elatted_hopper&#8217;, and it&#8217;s running under port 9000.<\/p>\n<p>Next, we will configure the Admin password for the Portainer.<\/p>\n<p>Open your web browser and type the server IP address with port 9000.<\/p>\n<p><em><strong>http:\/\/192.168.33.10:9000\/<\/strong><\/em><\/p>\n<p>You will get the page about the admin user and password configuration.<\/p>\n<p><a class=\"fancybox\" id=\"img-4\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_manage_docker_container_using_portainer_on_ubuntu_1604\/big\/4.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-3.png\" alt=\"Portainer UI\" width=\"500\" height=\"233\" title=\"\"><\/a><\/p>\n<p>Type your strong admin password and click the &#8216;Create user&#8217; button.<\/p>\n<p>Now we need to define which environment Portainer will connect. Portainer offers support for standalone Docker environment, Docker Swarm, and Swarm mode.<\/p>\n<p>For this guide, we will configure Portainer to connect to the local Docker environment.<\/p>\n<p><a class=\"fancybox\" id=\"img-5\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_manage_docker_container_using_portainer_on_ubuntu_1604\/big\/5.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-4.png\" alt=\"Connect Portainer to Docker\" width=\"500\" height=\"229\" title=\"\"><\/a><\/p>\n<p>Choose the &#8216;Local&#8217; environment and click &#8216;Connect&#8217; button.<\/p>\n<p>And now you will see the Portainer Admin Dashboard.<\/p>\n<p><a class=\"fancybox\" id=\"img-6\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_manage_docker_container_using_portainer_on_ubuntu_1604\/big\/6.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-5.png\" alt=\"Portainer Admin dashboard\" width=\"500\" height=\"289\" title=\"\"><\/a><\/p>\n<p>Portainer has been installed as a Docker Container on Ubuntu 16.04.<\/p>\n<h2 id=\"step-deploy-new-app-container\">Step 3 &#8211; Deploy New App Container<\/h2>\n<p>After the Portianer installation, we will run the Application Container using Portainer.<\/p>\n<p>Click the &#8216;App Template&#8217; menu.<\/p>\n<p>Now choose the application that you want to install. For this guide, we will install the &#8216;Ghost&#8217; blog as a Docker Container.<\/p>\n<p><a class=\"fancybox\" id=\"img-7\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_manage_docker_container_using_portainer_on_ubuntu_1604\/big\/7.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-6.png\" alt=\"Deploy app container\" width=\"500\" height=\"289\" title=\"\"><\/a><\/p>\n<p>Click &#8216;Ghost&#8217;.<\/p>\n<p>Type the container name &#8216;ghost-blog&#8217; and click the &#8216;Show advanced options&#8217;. On the &#8216;Port mapping&#8217; configuration, type port 80 on the &#8216;host&#8217;.<\/p>\n<p><a class=\"fancybox\" id=\"img-8\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_manage_docker_container_using_portainer_on_ubuntu_1604\/big\/8.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-7.png\" alt=\"Create container for Ghost Blog\" width=\"500\" height=\"289\" title=\"\"><\/a><\/p>\n<p>Now click &#8216;Deploy the container&#8217; button.<\/p>\n<p>And when it&#8217;s complete, you will get the container page as below.<\/p>\n<p><a class=\"fancybox\" id=\"img-9\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_manage_docker_container_using_portainer_on_ubuntu_1604\/big\/9.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-8.png\" alt=\"Container details\" width=\"500\" height=\"223\" title=\"\"><\/a><\/p>\n<p>Ghost is now installed as a Docker Container and it&#8217;s using port 80 on the host.<\/p>\n<p>Open your web browser and type the server IP address.<\/p>\n<p><em><strong>http:\/\/192.168.33.10\/<\/strong><\/em><\/p>\n<p>And you will get the &#8216;Ghost&#8217; blog homepage as below.<\/p>\n<p><a class=\"fancybox\" id=\"img-10\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_manage_docker_container_using_portainer_on_ubuntu_1604\/big\/10.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-9.png\" alt=\"Container deployed successfully\" width=\"500\" height=\"287\" title=\"\"><\/a><\/p>\n<h2 id=\"step-manage-docker-environment-using-portainer\">Step 4 &#8211; Manage Docker Environment Using Portainer<\/h2>\n<p>In this step, we will configure Docker Environments such as Docker images, Container, Volumes, and Networks.<\/p>\n<h3 id=\"manage-containers\">Manage Containers<\/h3>\n<p>Portainer provides a simple and easy way to use management for Docker Containers.<\/p>\n<p>Click the &#8216;Containers&#8217; menu on the left and you will get the page as below.<\/p>\n<p><a class=\"fancybox\" id=\"img-11\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_manage_docker_container_using_portainer_on_ubuntu_1604\/big\/11.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-10.png\" alt=\"Manage containers with Portainer\" width=\"500\" height=\"289\" title=\"\"><\/a><\/p>\n<p>We can start, stop, restart, create a new container, access the shell of the container, see the container log, and stats of the container from this Portainer container management.<\/p>\n<p>Shell of the Ghost container:<\/p>\n<p><a class=\"fancybox\" id=\"img-12\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_manage_docker_container_using_portainer_on_ubuntu_1604\/big\/12.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-11.png\" alt=\"Access shell of the container\" width=\"500\" height=\"219\" title=\"\"><\/a><\/p>\n<p>Ghost container logs:<\/p>\n<p><a class=\"fancybox\" id=\"img-13\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_manage_docker_container_using_portainer_on_ubuntu_1604\/big\/13.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-12.png\" alt=\"Log files of the container\" width=\"500\" height=\"247\" title=\"\"><\/a><\/p>\n<p>The container stats:<\/p>\n<p><a class=\"fancybox\" id=\"img-14\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_manage_docker_container_using_portainer_on_ubuntu_1604\/big\/14.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-13.png\" alt=\"Statistics of the Docker container\" width=\"500\" height=\"289\" title=\"\"><\/a><\/p>\n<h3 id=\"manage-docker-images\">Manage Docker Images<\/h3>\n<p>Click the &#8216;Images&#8217; menu and you will get the page as below.<\/p>\n<p><a class=\"fancybox\" id=\"img-15\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_manage_docker_container_using_portainer_on_ubuntu_1604\/big\/15.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-14.png\" alt=\"Manage Docker images\" width=\"500\" height=\"289\" title=\"\"><\/a><\/p>\n<p>Now we can see the list of docker images on our system, and we can create manually a new docker image, or pull\/download new images from the DockerHub repository.<\/p>\n<h3 id=\"manage-networks\">Manage Networks<\/h3>\n<p>From this menu, we create new custom networks for our Docker environment. Click the &#8216;Networks&#8217; menu.<\/p>\n<p><a class=\"fancybox\" id=\"img-16\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_manage_docker_container_using_portainer_on_ubuntu_1604\/big\/16.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-15.png\" alt=\"Manage network settings for Docker Containers\" width=\"500\" height=\"289\" title=\"\"><\/a><\/p>\n<h3 id=\"manage-volumes\">Manage Volumes<\/h3>\n<p>This menu provides an easy way to create new custom volumes for our container.<\/p>\n<p>We just need to create new custom volumes, and when we want to create new container the application, just attach it to the container through the &#8216;Advanced options&#8217; menu.<\/p>\n<p><a class=\"fancybox\" id=\"img-17\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_manage_docker_container_using_portainer_on_ubuntu_1604\/big\/17.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-16.png\" alt=\"Manage Docker Volumes\" width=\"500\" height=\"289\" title=\"\"><\/a><\/p>\n<p>Installation and configuration of the Portainer Docker Management UI on Ubuntu 16.04 has been completed successfully.<\/p>\n<h2 id=\"reference\">Reference<\/h2>\n<div>\n<p><b>Share this page:<\/b><\/p>\n<p>\n<a href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fubuntu-docker-portainer%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-17.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fubuntu-docker-portainer%2F&amp;text=How+to+Manage+Docker+Containers+using+Portainer+on+Ubuntu&amp;via=howtoforgecom&amp;related=howtoforgecom\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-18.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/howtoforgecom\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-19.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/plus.google.com\/share?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fubuntu-docker-portainer%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/04\/how-to-manage-docker-containers-using-portainer-on-ubuntu-20.png\" height=\"20\" alt=\"\" title=\"\"><\/a>\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Portainer is an open-source management UI for Docker, including Docker Swarm environment. Portainer makes it easier for you to manage your Docker containers, it allows you to manage containers, images, networks, and volumes from the web-based Portainer dashboard. In this tutorial, I will show you step-by-step how to install and configure Portainer on Ubuntu 16.04 &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-3385","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/3385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=3385"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/3385\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=3385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=3385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=3385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}