This series, 'Ghost on Plesk', will cover how to setup Ghost on Plesk via Docker and customize the configuration.

Step 1 - Install the Docker extension

Login to your Plesk panel. On the left menu, click on 'Extensions', search for and install 'Docker'. That was nice and easy!

Step 2 - Download the Ghost image

Go into 'Docker', found in the left panel under 'Server Management'.
2018-07-27-11_27_07-Adobe-Photoshop-CC-2017

Search for 'ghost' and install the latest image. Once the image has downloaded, it will automatically initiate a setup.

Step 3 - Setup Ghost container

ghost-docker-config-1

  • Enter your container name
  • Set your memory limit
  • Check 'Automatic start after system reboot' so your blog is available immediately upon system boot
  • Uncheck 'Automatic port mapping' and set your external port (avoid common ports)
  • Set 'Volume mapping', this will store your installation data in your web directory
    • in the destination field enter '/var/lib/ghost/content'
    • in the source field enter the path to your domain's directory, for example '/var/www/vhosts/domain.com/httpdocs/ghost/content'

Step 4 - Start Ghost

You are now ready to start the container for Ghost. Simply click 'OK' and you will be returned to the 'Overview' tab where you can monitor the console.

Step 5 - Setup Let's Encrypt

Head over to your domain settings page on Plesk and use the Let's Encrypt wizard to obtain a certificate.

Step 6 - Setup Docker proxy rules

ghost-docker-proxy-rules

Return to your domain settings in Plesk, and click on 'Docker Proxy Rules'. Add a new rule and click OK.

Step 7

Option 1: Setup your Ghost installation

You can now visit yourdomain.com to see your new blog live. It will be pre-populated with content and the default theme.

Head over to yourdomain.com/ghost to setup your account and complete installation.

Option 2: Advanced configuration of Ghost

Part 2 of this guide will cover how to modify the configuration of Ghost. Note that the Ghost documentation states that it is possible to modify the config using environment variables, however it also states,

Env vars should be lowercase, we realise this is a little odd, it's a limitation of nconf, but they do work!

Unfortunately Docker 1.3.1, the latest extension release on Plesk, contains a bug which does not support lowercase environment variables. Version 1.3.1 was released on 16 November 2016 according to the Plesk Onyx change log.
[AYamshanov, a staff member on the Plesk forums](C:\Users\Alpha\Desktop\2018-07-27 11_57_43-Question - Rocket Chat Docker _ Plesk Forum - Firefox Nightly.png): 'the bug with lowercase letters was fixed but new version not published yet... no ETA for publication of the new version' - almost 2 years since the last release! Please pressure Plesk to release this.

I do have a workaround for this which requires SSH/root access and this will be covered in part 2, including full custom configuration.


Credits:

Thanks to Raoul Kramer (@djpogo on Twitter) who inspired me to find an alternative solution, his original post: https://raoulkramer.de/install-ghost-on-plesk-onyx-vserver-with-docker/