How to easily deploy a full stack application in Portainer with templates

Implementing a complex Docker stack is not as challenging as you think, at least when Portainer is your GUI of choice. Find out how easy this is with Portainer’s templates.

When you think about deploying a full-stack containerized application, you probably expect it to be a tedious and cumbersome task to manually write a manifest and hope it deploys successfully. Although developers who are familiar with YAML and Docker manifests would say it’s not a difficult thing to do, if you’re remotely new to containers, the process can be quite daunting.

SEE: Hiring Kit: Python Developer (TechRepublic Premium)

Fortunately, there are apps like Portainer that go the extra mile to make managing and deploying containers exponentially easier than doing it from the command line. With Portainer, you can manage Docker containers, stacks, images, networks, volumes, and more, but one of the most impressive features is its ability to deploy a full-stack application from a simple application template.

You’ll find templates for stacks like Registry, NodeJS, NGINX, Apache, Caddy, MongoDB, Elasticsearch, SQL Server, Redis, Joomla, Drupal, Plane, Jenkins, Redmine, WordPress, and others.

Let me show you how it’s done.

Jump to:

What you’ll need to deploy a full-stack application

All you’ll need to follow in this tutorial is a running instance of Portainer. I recommend deploying Portainer in a MicroK8s environment and then installing Docker CE on the controller to add a Docker environment to the mix.

How to deploy a full stack application from a Portainer template

Start by logging into your Portainer instance and selecting the Docker environment from the list of environments (Figure A).

Figure A

The two basic environments that are available for Portainer.

Once the Docker environment loads, click Application Templates in the left sidebar (Figure B).

Figure B

Our Docker browsing environment.

A list of available application templates will appear. Let’s test the WordPress implementation. Scroll down until you see WordPress (Figure C).

Figure C

The list of WordPress full stack app templates.

From here, there are two paths to follow. First, you can click on the WordPress entry and deploy the full stack as-is. Alternatively, you can click Copy as Custom, which will open the template for editing (Figure D).

Figure D

Open the WordPress template as a custom implementation that you can then edit.

Using the Custom option allows you to edit the YAML files in Portainer Web Edibot so that you can customize your implementation.

If you simply want to quickly implement WordPress, simply click on the entry in the Templates list and, in the resulting window (Figure E), give the implementation a name, type wordpress as the database root user password and click Deploy Stack. If you want to change the password for added security, you’ll want to go the custom route. For testing purposes the simpler approach works fine.

Figure E

WordPress stack implementation using the built-in template.

The deployment will take a while to complete, but once it’s done you’ll be back in the list of stacks. Click on the newly deployed WordPress stack and you will see the published port listed (figure F).

figure F

Our WordPress stack has been implemented.

Give the containers enough time to spin up, and then point your browser to http://SERVER:PORT, where SERVER is the IP address of the controller node and port is the published port you saw when you saw the newly deployed stack. You will be greeted by the WordPress installer (Figure G), where you can point and click to finish the deployment.

Figure G

The WordPress installation wizard.

Complete Stacks Made Simple

You won’t find an easier way to learn the art of deploying a full-stack application with Docker. Using Portainer greatly simplifies the deployment and management of containers. Once full-stack developers start using Portainer, they’ll wonder how they ever managed without it. If you are interested in learning more about Docker, you can check out the following resources on the TechRepublic Academy:

Read Next: The 12 Best IDEs for Programming (TechRepublic)

Source link

James D. Brown
James D. Brown
Articles: 8405