{"id":86539,"date":"2023-01-19T20:11:10","date_gmt":"2023-01-19T20:11:10","guid":{"rendered":"https:\/\/www.techrepublic.com\/?p=4025003"},"modified":"2023-01-19T20:11:10","modified_gmt":"2023-01-19T20:11:10","slug":"how-to-add-a-new-development-environment-to-portainer","status":"publish","type":"post","link":"https:\/\/cloudnewshub.com\/?p=86539","title":{"rendered":"How to add a new development environment to Portainer"},"content":{"rendered":"<div id>\n<p> If you&#8217;ve deployed Portainer as a Kubernetes development platform and want to add a different environment, you&#8217;re in luck \u2014 the process is quite simple. <\/p>\n<\/div>\n<div id>\n<figure id=\"attachment_4025012\" aria-describedby=\"caption-attachment-4025012\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-article wp-image-4025012\" src=\"http:\/\/cloudnewshub.com\/wp-content\/uploads\/2023\/01\/how-to-add-a-new-development-environment-to-portainer.jpg\" alt=\"Smiling indian business man working on laptop at home office. Young indian student or remote teacher using computer remote studying, virtual training, watching online education webinar at home office.\" width=\"770\" height=\"513\"><figcaption id=\"caption-attachment-4025012\" class=\"wp-caption-text\">portainer-add-development-environment<\/figcaption><\/figure>\n<p>Recently, I outlined <a href=\"https:\/\/www.techrepublic.com\/article\/how-to-deploy-portainer-microk8s-environment\/\" target=\"_blank\" rel=\"noopener noreferrer\">how to deploy Portainer to a MicroK8s Kubernetes cluster<\/a>. The process is surprisingly easy and goes a long way to strip the complications from Kubernetes. That Kubernetes environment makes for a robust development process, but what if you also need to work with Docker? Thankfully, Portainer has many convenient Docker features that make deploying those containers a breeze.<\/p>\n<p><strong>SEE: <a href=\"https:\/\/www.techrepublic.com\/resource-library\/whitepapers\/hiring-kit-back-end-developer\/\" target=\"_blank\" rel=\"noopener noreferrer\">Hiring kit: Back-end Developer<\/a> (TechRepublic Premium)<\/strong><\/p>\n<p>With Portainer, you can add as many environments as you need to develop for Kubernetes or Docker within the same web-based GUI. In this tutorial, I\u2019ll show you how to add a Docker environment to the same Portainer instance that was <a href=\"https:\/\/www.techrepublic.com\/article\/how-to-deploy-portainer-microk8s-environment\/\" target=\"_blank\" rel=\"noopener noreferrer\">deployed using MicroK8s<\/a>.<\/p>\n<p>Jump to:<\/p>\n<h2 id=\"need\">What you\u2019ll need to add a Docker environment to Portainer<\/h2>\n<p>The only things you\u2019ll need for this process are a running instance of Portainer and a user with sudo privileges. I\u2019ll demonstrate this on the <a href=\"https:\/\/www.techrepublic.com\/article\/how-to-deploy-portainer-microk8s-environment\/\" target=\"_blank\" rel=\"noopener noreferrer\">Ubuntu Server 22.04 operating system<\/a>. If your OS differs, you\u2019ll need to alter the steps for installing Docker and Docker Compose.<\/p>\n<h2 id=\"install\">How to install Docker and Docker Compose<\/h2>\n<aside class=\"pinbox right\">\n<h3 class=\"heading\">Best business software<\/h3>\n<\/aside>\n<p>To begin, we must add the official Docker repository. We\u2019ll first add the GPG key with this command:<\/p>\n<p><code>curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg | sudo gpg --dearmor -o \/usr\/share\/keyrings\/docker-archive-keyring.gpg<\/code><\/p>\n<p>Next, add the Docker repository:<\/p>\n<p><code>echo \"deb [arch=amd64 signed-by=\/usr\/share\/keyrings\/docker-archive-keyring.gpg] https:\/\/download.docker.com\/linux\/ubuntu $(lsb_release -cs) stable\" | sudo tee \/etc\/apt\/sources.list.d\/docker.list &gt; \/dev\/null<\/code><\/p>\n<p>From here, you\u2019ll need to install the necessary dependencies with this command:<\/p>\n<p><code>sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release git -y<\/code><\/p>\n<h3>Install latest Docker Engine<\/h3>\n<p>Now, we can install the latest version of Docker Engine:<\/p>\n<p><code>sudo apt-get update<br \/><code>sudo apt-get install docker-ce docker-ce-cli containerd.io -y<\/code><\/code><\/p>\n<p>Next, you\u2019ll add your user to the docker group with this command:<\/p>\n<p><code>sudo usermod -aG docker $USER<\/code><\/p>\n<p>To finish out this section, log out and log back in for the changes to take effect.<\/p>\n<h3>Install Docker Compose<\/h3>\n<p>Finally, we\u2019ll install Docker Compose with this command:<\/p>\n<p><code>sudo apt-get install docker-compose -y<\/code><\/p>\n<p>With Docker installed, you\u2019re ready to add the new environment.<\/p>\n<h2 id=\"add\">How to add the Docker environment to Portainer<\/h2>\n<p>Now, you\u2019re ready to add the Docker environment to Portainer. To begin, log in to your Portainer instance and click Environments under Settings (<strong>Figure A<\/strong>).<\/p>\n<p><strong>Figure A<\/strong><\/p>\n<figure id=\"attachment_4025004\" aria-describedby=\"caption-attachment-4025004\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-4025004\" src=\"http:\/\/cloudnewshub.com\/wp-content\/uploads\/2023\/01\/how-to-add-a-new-development-environment-to-portainer-1.jpg\" alt width=\"305\" height=\"842\"><figcaption id=\"caption-attachment-4025004\" class=\"wp-caption-text\">The Portainer left navigation contains access to Environments.<\/figcaption><\/figure>\n<p>In the resulting window (<strong>Figure B<\/strong>), select Docker Standalone and click Start Wizard.<\/p>\n<p><strong>Figure B<\/strong><\/p>\n<figure id=\"attachment_4025005\" aria-describedby=\"caption-attachment-4025005\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-article wp-image-4025005\" src=\"http:\/\/cloudnewshub.com\/wp-content\/uploads\/2023\/01\/how-to-add-a-new-development-environment-to-portainer-2.jpg\" alt width=\"770\" height=\"370\"><figcaption id=\"caption-attachment-4025005\" class=\"wp-caption-text\">There are a few types of environments you can add to Portainer.<\/figcaption><\/figure>\n<p>In the resulting window (<strong>Figure C<\/strong>), select Agent to reveal the Docker command you must run on the hosting server to add the Portainer agent.<\/p>\n<p><strong>Figure C<\/strong><\/p>\n<figure id=\"attachment_4025006\" aria-describedby=\"caption-attachment-4025006\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-article wp-image-4025006\" src=\"http:\/\/cloudnewshub.com\/wp-content\/uploads\/2023\/01\/how-to-add-a-new-development-environment-to-portainer-3.jpg\" alt width=\"770\" height=\"486\"><figcaption id=\"caption-attachment-4025006\" class=\"wp-caption-text\">We\u2019re adding the Docker environment by way of an agent.<\/figcaption><\/figure>\n<p>The command to do this is:<\/p>\n<p><code>docker run -d -p 9001:9001 --name portainer_agent --restart=always -v \/var\/run\/docker.sock:\/var\/run\/docker.sock -v \/var\/lib\/docker\/volumes:\/var\/lib\/docker\/volumes portainer\/agent:2.16.2<\/code><\/p>\n<p>Once you\u2019ve run that command, give the environment a Name and an Environment Address, and then click Connect. The Environment Address will be in the form of SERVER:9001, where SERVER is the IP address of the hosting server.<\/p>\n<p>The connection should be made very quickly. If you then click Home in the upper-left corner, you\u2019ll see your new Docker environment is ready to use (<strong>Figure D<\/strong>).<\/p>\n<p><strong>Figure D<\/strong><\/p>\n<figure id=\"attachment_4025007\" aria-describedby=\"caption-attachment-4025007\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-article wp-image-4025007\" src=\"http:\/\/cloudnewshub.com\/wp-content\/uploads\/2023\/01\/how-to-add-a-new-development-environment-to-portainer-4.jpg\" alt width=\"770\" height=\"294\"><figcaption id=\"caption-attachment-4025007\" class=\"wp-caption-text\">Our Docker environment has been added and is ready for use.<\/figcaption><\/figure>\n<h2 id=\"simplify\">Simplify your container development process<\/h2>\n<p>If you\u2019re a <a href=\"https:\/\/www.techrepublic.com\/article\/how-to-deploy-portainer-microk8s-environment\/\" target=\"_blank\" rel=\"noopener noreferrer\">platform engineer<\/a>, developer or other user who is looking to simplify your container development process, I recommend using Portainer for Kubernetes and Docker. This web GUI has everything you need to not only perfect your container deployments but manage them as well.<\/p>\n<p><strong>Read next: <a href=\"https:\/\/www.techrepublic.com\/article\/how-to-deploy-portainer-microk8s-environment\/\" target=\"_blank\" rel=\"noopener noreferrer\">The 12 best IDEs for programming<\/a> (TechRepublic)<\/strong><\/p>\n<p> <!-- default newsletter at the end --> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;ve deployed Portainer as a Kubernetes development platform and want to add a different environment, you&#8217;re in luck \u2014 the process is quite simple. portainer-add-development-environment Recently, I outlined how to deploy Portainer to a MicroK8s Kubernetes cluster. The process is surprisingly easy and goes a long way to strip the complications from Kubernetes. That [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":86540,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40,783,315,316,177,27],"tags":[],"class_list":["post-86539","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud","category-cloudsync","category-containers","category-kubernetes","category-open-source","category-software"],"_links":{"self":[{"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=\/wp\/v2\/posts\/86539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=86539"}],"version-history":[{"count":0,"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=\/wp\/v2\/posts\/86539\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=\/wp\/v2\/media\/86540"}],"wp:attachment":[{"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=86539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=86539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=86539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}