{"id":102,"date":"2023-08-05T08:01:47","date_gmt":"2023-08-05T08:01:47","guid":{"rendered":"http:\/\/it4home.dk\/?p=102"},"modified":"2023-08-06T09:14:31","modified_gmt":"2023-08-06T09:14:31","slug":"installing-portainer-community-edition-with-docker","status":"publish","type":"post","link":"https:\/\/it4home.dk\/index.php\/2023\/08\/05\/installing-portainer-community-edition-with-docker\/","title":{"rendered":"Installing Portainer Community Edition with Docker"},"content":{"rendered":"<div class=\"pdfprnt-buttons pdfprnt-buttons-post pdfprnt-top-right\"><a href=\"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/posts\/102?print=pdf\" class=\"pdfprnt-button pdfprnt-button-pdf\" target=\"_blank\" ><\/a><a href=\"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/posts\/102?print=print\" class=\"pdfprnt-button pdfprnt-button-print\" target=\"_blank\" ><img decoding=\"async\" src=\"https:\/\/it4home.dk\/wp-content\/plugins\/pdf-print\/images\/print.png\" alt=\"image_print\" title=\"Print Content\" \/><\/a><\/div>\n<p class=\"wp-block-paragraph\">Introduction:<br>Portainer is a powerful open-source container management tool that simplifies Docker deployment and administration. In this guide, we&#8217;ll walk you through the installation process for Portainer Community Edition using Docker.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Step 1: Stop Existing Portainer Container (Optional)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you have an existing Portainer container that you want to replace, you can stop it using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker stop portainer<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Step 2: Create Docker Volume for Portainer Data<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a Docker volume to store Portainer&#8217;s data persistently:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker volume create portainer_data<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Step 3: Install Portainer Community Edition<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run the Portainer Community Edition container with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker run -d -p 9000:9000 \\\n  --name=portainer \\\n  --restart=always \\\n  -v \/var\/run\/docker.sock:\/var\/run\/docker.sock \\\n  -v portainer_data:\/data \\\n  portainer\/portainer-ce<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Explanation of options used:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>-d<\/code>: Run the container in the background (detached mode).<\/li>\n\n\n\n<li><code>-p 9000:9000<\/code>: Map port 9000 from the container to port 9000 on the host system. This allows you to access Portainer&#8217;s web interface at <code>http:\/\/localhost:9000<\/code>.<\/li>\n\n\n\n<li><code>--name=portainer<\/code>: Assign the name &#8220;portainer&#8221; to the container for easy management.<\/li>\n\n\n\n<li><code>--restart=always<\/code>: Configure the container to automatically restart if it stops unexpectedly.<\/li>\n\n\n\n<li><code>-v \/var\/run\/docker.sock:\/var\/run\/docker.sock<\/code>: Mount the Docker socket on the host to the container. This allows Portainer to interact with the Docker engine on the host.<\/li>\n\n\n\n<li><code>-v portainer_data:\/data<\/code>: Mount the Docker volume &#8220;portainer_data&#8221; to the &#8220;\/data&#8221; directory inside the container. This volume stores Portainer&#8217;s data, ensuring persistence across container restarts.<\/li>\n\n\n\n<li><code>portainer\/portainer-ce<\/code>: Specifies the Docker image to use for running Portainer Community Edition.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Step 4: Access Portainer Web Interface<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the Portainer container is up and running, open a web browser and navigate to <code>http:\/\/localhost:9000<\/code>. You will be directed to Portainer&#8217;s web interface. Follow the setup wizard to create an admin user and configure Portainer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Congratulations! You have successfully installed Portainer Community Edition using Docker. You can now start managing your Docker containers and services through the intuitive Portainer interface.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Enjoy the simplicity and power of Docker management with Portainer Community Edition! Happy containerizing!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction:Portainer is a powerful open-source container management tool that simplifies Docker deployment and administration. In this guide, we&#8217;ll walk you through the installation process for Portainer Community Edition using Docker. Step 1: Stop Existing&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":197,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[2],"tags":[35],"class_list":["post-102","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker","tag-ok"],"_links":{"self":[{"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/posts\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/comments?post=102"}],"version-history":[{"count":2,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/posts\/102\/revisions"}],"predecessor-version":[{"id":128,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/posts\/102\/revisions\/128"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/media\/197"}],"wp:attachment":[{"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/media?parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/categories?post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/tags?post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}