Let’s talk about the Plesk Docker Extension

Docker is a software technology that provides containers. That’s an extra layer of abstraction and automation of operating-system-level virtualization. As a flexible Plesk tool, Docker can help you perform a wide variety of tasks. Today, I’ll show you how Docker can make your life easier – with examples.

Note: All examples in this article were made using the free version of the Docker extension for Plesk.

Known Issues and Limitations Before deploying a Docker environment, it’s good to know its limitations:

  • All ports specified in the Docker file are, by default, exposed. In a cloud environment, you can usually make them available only from the local host using the Cloud firewall and the default Security Group. This can be both an advantage and a drawback.
  • Always check whether your containers are accessible from the outside. Make sure to block outside access to the container unless it’s required
  • You cannot set read-only permission. All volumes are always mapped with read-write permissions.
  • You cannot use the Docker Compose tool and its configuration files.

Deploying and installing Plesk Docker

To deploy the environment and get your hands on this extension you’ll need to:

  1. Receive a valid SSL/TLS certificate from Let’s Encrypt. (Technically this isn’t necessary, but you know, some people hate self-signed certificate warnings.)
  2. Click “Extensions” in the menu on the left.
  1. Search for the Plesk Docker extension.
  1. Click “Install”. Let it finish.
  1. Open the extension.

Plesk Docker Extension Use Cases

Hosting provider

  • On the Plesk forum, customers may ask about upgrading the vendor’s MySQL/MariaDB to the latest version.
  • Some of your customers may want to use a web application requiring MySQL 5.7 or MariaDB 10.2. Others may want to use the latest version of the database server because of superior performance.
  • A customer may want to have full control – not just over their databases, but over the MySQL server itself.

Web Application Developer

Imagine, you begin developing a new web application. The application will store its data in an SQL-like database. Which SQL-like database should you use? You probably want to write a web application that can work with all popular databases. This will help you get as many customers as possible. So, what databases do you know?

  • Officially supported by Plesk (not a full list, only an example)
    • MySQL 5.5/5.6/5.7
    • MariaDB 10.0/10.1
    • PostgreSQL 9.5
  • Not supported by Plesk
    • MySQL 8.0
    • MariaDB 10.2
    • PostgreSQL 9.6
  • Something else?
    • Microsoft SQL Server on Linux

Ok, your web application is done. You want to test it with all these databases. How can you do it? Deploying containers with all necessary databases Let’s take a look at container deployment, step-by-step. We can use the official containers from the Docker Hub:

But in this example, we’re going to deploy a container with MariaDB 10.0. Here it is:

  • Search for available containers with MariaDB and select the required version.
  • Download and wait for it to finish.
  1. Configure the required settings:
    1. Switch on auto-start.
    2. Configure port mapping.
    3. Add an environment variable with the ‘root’ user password.
  1. Create a container and wait for it to launch.
  1. Repeat these steps for MariaDB 10.1/10.2, MySQL 5.5/5.6/5.7/8.0, and PostgreSQL 9.5/9.6.

Add these database servers to Plesk In the shots below, you’ll see the database servers you and your customers can use with Plesk. But first, you’ll need to add them. If a database server is not supported by Plesk, you can connect to the database server directly (MySQL 8.0). Here’s what the output looks like from my console:

And what about Linux? Yup! It’s possible too. We can have MSSQL from Microsoft under Plesk for LinuxCheck it out:

WordPress Administrator

You need to install the Memcached daemon to speed up WordPress and decrease CPU utilization. Note: You must disable access to Memcached from anywhere except WordPress, for security reasons. In this example, Plesk is deployed in Google Cloud and is protected by the Cloud Platform Firewall. Memcached

  1. Check your firewall settings.
  2. Make sure you’ve blocked all external connections to memcached.
  3. Search for Memcached container and install.
  4. Select the ‘auto-start’ checkbox and configure port mapping.
  5. Start the container. Check that it’s all running fine.

Small Businesses

So you’re an organisation that wants to use a self-owned, Nextcloud-based resource for file sharing. Seriously, consider Plesk and Docker. You can do it in just a few clicks.

  1. Search for and deploy a container with Nextcloud. Wait for it to launch.
  2. Configure proxy rules for Docker under “Websites & Domains”.
  3. Open the Nextcloud web interface and set ‘admin’ username and password.
  1. All done! You can now use Nextcloud.
 

Developing in Go

Although Plesk doesn’t have extensions for working with Go, you can still write an application in Go and run it on a Plesk server with Docker. And if you can’t write in Go for some reason, then you can deploy git-service written in Go.

Try out our new Plesk versions

In case you missed it – You can even install Plesk in a Docker container using the Plesk with Docker extension! This way you can try out an early version of Plesk and check out the new features and extensions. But your publicly available websites will still work on a stable version of Plesk.

6 Comments

  1. Alexander, Thank you. Very good read!!

  2. Hi; vey good post. Can you make a new one explaining how to deploy Rocket.Chat in Docker and how to linking more than one container? This could be a good idea to deploy several containers for diferents teams, using sub domines for each team.

  3. I am running into the issue, after creation of a docker container for mysql8 when adding to the database servers: Server sent charset unknown to the client. Please, report to the developers

    Any tipps/hints on how to solve that? Using current Onyx 17.5.x

  4. Plesk extension, Docker support includes: Access to a variety of modern technologies like mongodb, redis, memcached and others. I can gain the knowledge from your site which is really interesting.

  5. This is what happens when I want to start MariaDB docker:

    error: database is uninitialized and password option is not specified
    You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD

Add a Comment

Your email address will not be published. Required fields are marked *

GET LATEST NEWS AND TIPS

  • Yes, please, I agree to receiving my personal Plesk Newsletter! WebPros International GmbH and other WebPros group companies may store and process the data I provide for the purpose of delivering the newsletter according to the WebPros Privacy Policy. In order to tailor its offerings to me, Plesk may further use additional information like usage and behavior data (Profiling). I can unsubscribe from the newsletter at any time by sending an email to [email protected] or use the unsubscribe link in any of the newsletters.

  • Hidden
  • Hidden
  • Hidden
  • Hidden
  • Hidden
  • Hidden

Related Posts

Knowledge Base