Let's talk about the Plesk Docker Extension | Plesk

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.Plesk-Docker-1
    3. Search for the Plesk Docker extension.Plesk-Docker-2
    4. Click “Install”. Let it finish.Plesk-Docker-3Plesk-Docker-4
    5. Open the extension.Plesk-Docker-5

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:

Plesk-Docker-6

  1. Search for available containers with MariaDB and select the required version.
  2. Download and wait for it to finish.Plesk-Docker-7
  3. Configure the required settings:
    1. Switch on auto-start.
    2. Configure port mapping.
    3. Add an environment variable with the ‘root’ user password.

    Plesk-Docker-8

      4. Create a container and wait for it to launch.

    Plesk-Docker-9

    5. Repeat these steps for MariaDB 10.1/10.2, MySQL 5.5/5.6/5.7/8.0, and PostgreSQL 9.5/9.6.

    Plesk-Docker-10

    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:

    Plesk-Docker-Database-Server-1  Plesk-Docker-Database-Server-2  Plesk-Docker-Database-Server-3

    And what about Linux?

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

    Plesk-Docker-Linux-1  Plesk-Docker-Linux-2

    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.Memcached-Plesk-Docker-1Memcached-Plesk-Docker-2Memcached-Plesk-Docker-3Memcached-Plesk-Docker-4

    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.Plesk-Docker-Business-NextCloud-1Plesk-Docker-Business-NextCloud-2Plesk-Docker-Business-NextCloud-3Plesk-Docker-Business-NextCloud-4Plesk-Docker-Business-NextCloud-5
    4. 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.

    Plesk-Docker-Developing-in-Go-1Plesk-Docker-Developing-in-Go-2Plesk-Docker-Developing-in-Go-3Plesk-Docker-Developing-in-Go-4Plesk-Docker-Developing-in-Go-5Plesk-Docker-Developing-in-Go-6

    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.

    try-plesk-versions-1-deploytry-plesk-versions-2-localhost-searchtry-plesk-versions-3

Comments
  • Jörg
    Reply

    Alexander, Thank you. Very good read!!

Leave a Comment

Start typing and press Enter to search