Docker has been a hot topic this year. Modern software should have an option to be installed as a Docker container. Not long ago we have created a Docker image for Plesk. This article describes how to install and use Plesk Docker container.
The official Docker image of Plesk has already been published on Docker Hub. It means that the installation is very simple. Versions 12.0 and 12.5 are available, and 12.5 is marked with the “latest” tag.
Docker has an excellent desktop client called Kitematic we will be using to install Plesk as a Docker container. The procedures described below presume that you have already installed Kitematic (Docker Toolbox).
In order to install Plesk, click the “+ NEW” button, type “plesk” in the search field, hit the Enter key, and click “Create” inside the box describing the Plesk image to create a container with Plesk.
Once the container creation process has finished, you need to log in to Plesk. Docker uses port mapping, and we need to find a mapping for port 8880.
Kitematic provides an additional convenience by presenting access URLs as links. So you can click one and you’ll see the Plesk login page open in your browser.
The default credentials for Plesk (as a Docker image) are:
- Login: admin
- Password: changeme
After logging in you will see the Plesk web interface.
Another option to install a container with Plesk is to use the “docker” command line utility.
To create a container, use the following command:
docker run -d -it -p 8880:8880 plesk/plesk
This command will create a container with Plesk based on the “plesk/plesk” image. The next step is to open the URL of the Plesk web interface. It should look like this: http://< docker-host-ip >:8880
If you do not know the IP of your Docker host, use the “docker-machine” command to retrieve it:
docker-machine ip default
Where “default” is the name of the Docker host (“default” name is used in case of the Docker Toolbox installation).
Why use Plesk as a Docker container? First of all, it could be used for evaluation purposes. The Plesk Docker image is already pre-configured and comes with a trial license. It means that you get a “ready-to-use” Plesk in a matter of a few seconds. There is no need to perform the installation process, look for the trial license key, and so on. You can start the evaluation process immediately.
Another option is to use Plesk as a Docker container in a way Plesk is regularly used in. Similar to VPS or dedicated server, Plesk as a Docker container can be used to provide shared hosting or satisfy “power user” needs (hosting domains for individual purposes). If you are already familiar with the Plesk image for Amazon, the Docker image will look pretty similar.
Plesk packaging as a Docker image is still not mature, and there are some known limitations.
If you are using Ubuntu as the Docker host, please disable (or remove) AppArmor. At the moment,Plesk installation fails if AppArmor is enabled.
Manipulations with license could lead to a 502 error. To work around the problem, run the container in the privileged mode (–privileged option for “docker run” command).
Try to avoid any manipulations with the hostname using the Plesk interface. At the moment, such manipulations could lead to errors.
Sooner or later, you will probably think of image customization. You may want to tinker with the configuration settings, customize the UI, or change the set of installed components.
If you want to fine-tune the original image, we strongly recommend to use the Plesk image as the base image (“FROM” directive in Dockerfile).
If you want to change the list of installed components, or have containers without some particular component, you need to customize the original Dockerfile of the Plesk image. Dockerfiles for Plesk are located on GitHub: https://github.com/plesk/docker/
There is a lot of buzz around Docker that is hard to ignore. The simplest way to understand the Docker purpose is to play around with an image (like Plesk) and create a bunch of containers. Earlier on, only some providers such as Amazon had the ability to create a new instance of Plesk within a few seconds, but now with the assistance of Docker, you can do it by yourselves in a very simple manner.
Here is the list of useful links:
- Official Docker site: https://www.docker.com/
- Official place of Plesk image on Docker Hub: https://hub.docker.com/r/plesk/plesk/
- Dockerfile for Plesk 12.5: https://github.com/plesk/docker/blob/master/12.5/Dockerfile
You can use GitHub repo https://github.com/plesk/docker/ to submit issues or feature requests. Also feel free to send us pull requests.