{"id":6483,"date":"2018-08-31T14:32:45","date_gmt":"2018-08-31T10:32:45","guid":{"rendered":"https:\/\/www.howtoforge.com\/tutorial\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker\/"},"modified":"2018-08-31T14:32:45","modified_gmt":"2018-08-31T10:32:45","slug":"docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker\/","title":{"rendered":"Docker Guide: Deploying Ghost Blog with MySQL and Traefik with Docker"},"content":{"rendered":"<p>Ghost is a powerful open source publishing and blog platform based on nodejs. It&#8217;s well designed and easy to use. The ghost platform is written in JavaScript and uses node.js as a runtime environment. The first Ghost version released in 2013 under the MIT license..<\/p>\n<p>Traefik is modern HTTP reverse proxy and load balancer for microservices. Traefik makes all microservices deployment easy, integrated with existing infrastructure components such as Docker, Swarm Mode, Kubernetes, Amazon ECS, Rancher, Etcd, Consul etc.<\/p>\n<p>In this tutorial, we will show step-by-step how to install and configure Ghost as a Docker container. We will install and configure Ghost under the latest Docker CE version, use the MySQL as a database and use the Traefik as a Reverse Proxy.<\/p>\n<h2 id=\"prerequisites\">Prerequisites<\/h2>\n<ul>\n<li>Ubuntu 18.04 LTS<\/li>\n<li>Root privileges<\/li>\n<\/ul>\n<h2 id=\"what-we-will-do\">What we will do<\/h2>\n<ol>\n<li>Install Docker CE on Ubuntu 18.04 LTS<\/li>\n<li>Setup Docker for Non-root User<\/li>\n<li>Install Docker Compose<\/li>\n<li>Configure Ghost Stack<\/li>\n<\/ol>\n<ul>\n<li>Create a Custom Network<\/li>\n<li>Create a Project Directory<\/li>\n<li>Create and Configure MySQL Container<\/li>\n<li>Create and Configure Traefik Reverse Proxy<\/li>\n<li>Create and Configure Ghost Container<\/li>\n<\/ul>\n<li>Deploy Ghost with MySQL and Traefik<\/li>\n<li>Testing<\/li>\n<h2 id=\"step-install-docker-ce-on-ubuntu-lts\">Step 1 &#8211; Install Docker CE on Ubuntu 18.04 LTS<\/h2>\n<p>The first step we will do in this tutorial is to install the latest docker-ce version of the system. The docker-ce version can be installed from the official docker repository.<\/p>\n<p>Add the docker key and docker-ce repository.<\/p>\n<p class=\"command\">curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg | sudo apt-key add &#8211;<br \/>sudo add-apt-repository \\<br \/>\u00a0\u00a0 &#8220;deb [arch=amd64] https:\/\/download.docker.com\/linux\/ubuntu \\<br \/>\u00a0\u00a0 $(lsb_release -cs) \\<br \/>\u00a0\u00a0 stable&#8221;<\/p>\n<p>The command will automatically update all repositories on the system.<\/p>\n<p>Now install docker using the apt command below.<\/p>\n<p class=\"command\">sudo apt install docker-ce -y<\/p>\n<p>After the installation is complete, start the docker service and enable it to launch every time at system startup.<\/p>\n<p class=\"command\">systemctl start docker<br \/>systemctl enable docker<\/p>\n<p>The latest docker-ce version has been installed on the Ubuntu 18.04 system.<\/p>\n<p><a class=\"fancybox\" id=\"img-1\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_deploying_ghost_blog_with_mysql_and_traefik_with_docker\/big\/1.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker.png\" alt=\"Installing Docker CE\" width=\"500\" height=\"364\" title=\"\"><\/a><\/p>\n<h2 id=\"step-setup-docker-for-nonroot-user\">Step 2 &#8211; Setup Docker for Non-root User<\/h2>\n<p>In this guide, all container microservices will be run under the normal\/non-root user. So we need to configure the user to be able to run the Docker container and run the sudo command for root privileges.<\/p>\n<p>Create a new user named &#8216;hakase&#8217; and create the password.<\/p>\n<p class=\"command\">useradd -m -s \/bin\/bash hakase<br \/>passwd hakase<\/p>\n<p>Now assign the &#8216;hakase&#8217; user to the &#8216;sudo&#8217; and &#8216;docker&#8217; groups.<\/p>\n<p class=\"command\">usermod -a -G root hakase<br \/>usermod -a -G docker hakase<\/p>\n<p>And restart the docker service.<\/p>\n<p class=\"command\">systemctl restart docker<\/p>\n<p>The &#8216;hakase&#8217; can now run the docker container and run the sudo command for root privileges.<\/p>\n<p><a class=\"fancybox\" id=\"img-2\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_deploying_ghost_blog_with_mysql_and_traefik_with_docker\/big\/2.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-1.png\" alt=\"Setup Docker for Non-root User\" width=\"500\" height=\"216\" title=\"\"><\/a><\/p>\n<p>Login as user &#8216;hakase&#8217; and run the docker hello-world container.<\/p>\n<p class=\"command\">su &#8211; hakase<br \/>docker run -it hello-world<\/p>\n<p>And following is the result.<\/p>\n<p><a class=\"fancybox\" id=\"img-3\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_deploying_ghost_blog_with_mysql_and_traefik_with_docker\/big\/3.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-2.png\" alt=\"Test docker as non-root user\" width=\"500\" height=\"428\" title=\"\"><\/a><\/p>\n<h2 id=\"step-install-docker-compose\">Step 3 &#8211; Install Docker Compose<\/h2>\n<p>In this tutorial, we will install the docker compose 1.21 from a binary file on Github repository.<\/p>\n<p>Download the docker-compose binary to the &#8216;\/usr\/local\/bin&#8217; directory.<\/p>\n<p class=\"command\">sudo curl -L https:\/\/github.com\/docker\/compose\/releases\/download\/1.21.2\/docker-compose-$(uname -s)-$(uname -m) -o \/usr\/local\/bin\/docker-compose<\/p>\n<p>And make the &#8216;docker-compose&#8217; file executable by changing the file permission.<\/p>\n<p class=\"command\">sudo chmod +x \/usr\/local\/bin\/docker-compose<\/p>\n<p>The docker compose has been installed &#8211; check it using the command below.<\/p>\n<p class=\"command\">docker-compose version<br \/>docker version<\/p>\n<p><a class=\"fancybox\" id=\"img-4\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_deploying_ghost_blog_with_mysql_and_traefik_with_docker\/big\/4.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-3.png\" alt=\"Install Docker Compose\" width=\"500\" height=\"269\" title=\"\"><\/a><\/p>\n<p>Docker-compose 1.21 with Docker-ce 1.18 has been installed.<\/p>\n<h2 id=\"step-configure-ghost-stack\">Step 4 &#8211; Configure Ghost Stack<\/h2>\n<p>In this step, we will configure the docker and create a new docker-compose file for the ghost installation.<\/p>\n<p>We will create a new docker custom network and create a new docker-compose yml file that contains three main services, including MySQL database, Traefik reverse proxy, and Ghost blog itself.<\/p>\n<h3 id=\"create-a-custom-network\">Create a Custom Network<\/h3>\n<p>Show the available docker network using docker network command below.<\/p>\n<p class=\"command\">docker network ls<\/p>\n<p>Create a new custom docker network for the traefik reverse proxy named &#8216;traefiknet&#8217;.<\/p>\n<p class=\"command\">docker network create traefiknet<\/p>\n<p>Now check again the available network on the docker system.<\/p>\n<p class=\"command\">docker network ls<\/p>\n<p><a class=\"fancybox\" id=\"img-5\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_deploying_ghost_blog_with_mysql_and_traefik_with_docker\/big\/5.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-4.png\" alt=\"Create a Custom Network\" width=\"500\" height=\"283\" title=\"\"><\/a><\/p>\n<p>The custom network for Treafik named &#8216;traefiknet&#8217; has been created.<\/p>\n<h3 id=\"create-a-project-directory\">Create a Project Directory<\/h3>\n<p>After creating the docker custom network, we will create a new project directory named &#8216;ghost&#8217; and create a new docker-compose.yml file.<\/p>\n<p>Login to the &#8216;hakase&#8217; user.<\/p>\n<p class=\"command\">su &#8211; hakase<\/p>\n<p>Create a new &#8216;ghost&#8217; directory and change the working directory to it.<\/p>\n<p class=\"command\">mkdir ghost\/<br \/>cd ghost\/<\/p>\n<p>And create a new docker-compose file.<\/p>\n<p class=\"command\">touch docker-compose.yml<\/p>\n<h3 id=\"create-and-configure-mysql-service\">Create and Configure MySQL Service<\/h3>\n<p>MySQL is the first service we want to create, and we want to create the MySQL container with configurations below.<\/p>\n<ul>\n<li>We will be using the MySQL 5.7 docker image.<\/li>\n<li>Mount the MySQL data directory to the local docker host directory.<\/li>\n<li>Running the MySQL service on the local internal network.<\/li>\n<li>Configure MySQL user and password.<\/li>\n<ul>\n<li>MySQL root password: mypassword<\/li>\n<li>Database for the ghost named &#8216;ghostdb&#8217; with user &#8216;ghost&#8217; and password is &#8216;ghostdbpass&#8217;<\/li>\n<\/ul>\n<li>The MySQL container will be named as &#8216;mysql&#8217;.<\/li>\n<\/ul>\n<p>Inside the &#8216;ghost&#8217; directory, create a new directory named &#8216;data&#8217; and edit the &#8216;docker-compose.yml&#8217; file.<\/p>\n<p class=\"command\">mkdir -p data\/<br \/>vim docker-compose.yml<\/p>\n<p>Paste the configuration below.<\/p>\n<pre>version: '3.3'&#13;\n&#13;\nservices:&#13;\n&#13; mysql:&#13; image: mysql:5.7&#13; restart: always&#13; volumes:&#13; - .\/data:\/var\/lib\/mysql&#13; labels:&#13; - \"traefik.enable=false\"&#13; networks:&#13; - internal&#13; environment:&#13; MYSQL_ROOT_PASSWORD: mypassword&#13; MYSQL_USER: ghost&#13; MYSQL_PASSWORD: ghostdbpass&#13; MYSQL_DATABASE: ghostdb&#13; container_name: mysql<\/pre>\n<p>Save and exit.<\/p>\n<h3 id=\"create-and-configure-traefik-reverse-proxy\">Create and Configure Traefik Reverse Proxy<\/h3>\n<p>After creating the MySQL service, we will create and configure the traefik reverse proxy container.<\/p>\n<p>Before editing the &#8216;docker-compose.yml&#8217; script, we need to create a new traefik configuration named &#8216;traefik.toml&#8217;.<\/p>\n<p class=\"command\">vim traefik.toml<\/p>\n<p>Paste traefik rule configuration below.<\/p>\n<pre>#Traefik Global Configuration&#13;\ndebug = false&#13;\ncheckNewVersion = true&#13;\nlogLevel = \"ERROR\"&#13;\n&#13;\n#Define the EntryPoint for HTTP and HTTPS&#13;\ndefaultEntryPoints = [\"https\",\"http\"]&#13;\n&#13;\n#Define the HTTP port 80 and&#13;\n#HTTPS port 443 EntryPoint&#13;\n#Enable automatically redirect HTTP to HTTPS&#13;\n[entryPoints]&#13;\n[entryPoints.http]&#13;\naddress = \":80\"&#13;\n[entryPoints.http.redirect]&#13;\nentryPoint = \"https\"&#13;\n[entryPoints.https]&#13;\naddress = \":443\"&#13;\n[entryPoints.https.tls]&#13;\n&#13;\n#Enable Traefik Dashboard on port 8080&#13;\n#with basic authentication method&#13;\n#hakase and password&#13;\n[entryPoints.dash]&#13;\naddress=\":8080\"&#13;\n[entryPoints.dash.auth]&#13;\n[entryPoints.dash.auth.basic]&#13; users = [&#13; \"hakase:$apr1$hEgpZUN2$OYG3KwpzI3T1FqIg9LIbi.\",&#13; ]&#13;\n&#13;\n[api]&#13;\nentrypoint=\"dash\"&#13;\ndashboard = true&#13;\n&#13;\n#Enable retry sending a request if the network error&#13;\n[retry]&#13;\n&#13;\n#Define Docker Backend Configuration&#13;\n[docker]&#13;\nendpoint = \"unix:\/\/\/var\/run\/docker.sock\"&#13;\ndomain = \"hakase-labs.io\"&#13;\nwatch = true&#13;\nexposedbydefault = false&#13;\n&#13;\n#Letsencrypt Registration&#13;\n#Define the Letsencrypt ACME HTTP challenge&#13;\n[acme]&#13;\nemail = \"<a href=\"https:\/\/www.howtoforge.com\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"4b232a202a382e0b2c262a222765282426\" target=\"_blank\" rel=\"noopener\">[email\u00a0protected]<\/a>\"&#13;\nstorage = \"acme.json\"&#13;\nentryPoint = \"https\"&#13;\nOnHostRule = true&#13; [acme.httpChallenge]&#13; entryPoint = \"http\"<\/pre>\n<p>Save and exit.<\/p>\n<p>Now we need to create a new file for the SSL Letsencrypt configuration &#8216;acme.json&#8217;. <span class=\"highlight\">It&#8217;s used to store all letsencrypt generate a log.<\/span><\/p>\n<p>Create the blank &#8216;acme.json&#8217; file and change the permission to 600.<\/p>\n<p class=\"command\">touch acme.json<br \/>chmod 600 acme.json<\/p>\n<p>Next, we will edit the &#8216;docker-compose.yml&#8217; script and add the traefik service configuration.<\/p>\n<ul>\n<li>We will be using the latest traefik docker image.<\/li>\n<li>The container will be named as &#8216;traefik&#8217;<\/li>\n<li>It&#8217;s used the custom network &#8216;traefiknet&#8217;, and expose the HTTP and HTTPS ports.<\/li>\n<li>Mount the docker sock file and the traefik configuration &#8216;traefik.toml&#8217; and &#8216;acme.json&#8217;<\/li>\n<li>We defined the traefik dashboard URL and backend through the docker labels.<\/li>\n<\/ul>\n<p>Edit the &#8216;docker-compose.yml&#8217;.<\/p>\n<p class=\"command\">vim docker-compose.yml<\/p>\n<p>Paste the traefik service configuration below.<\/p>\n<pre> traefik:&#13; image: traefik:latest&#13; command: --docker&#13; ports:&#13; - 80:80&#13; - 443:443&#13; labels:&#13; - \"traefik.enable=true\"&#13; - \"traefik.backend=dashboard\"&#13; - \"traefik.frontend.rule=Host:traef.hakase-labs.io\"&#13; - \"traefik.port=8080\"&#13; networks:&#13; - traefiknet&#13; volumes:&#13; - \/var\/run\/docker.sock:\/var\/run\/docker.sock&#13; - .\/traefik.toml:\/traefik.toml&#13; - .\/acme.json:\/acme.json&#13; container_name: traefik&#13; restart: always<\/pre>\n<p>Save and exit.<\/p>\n<h3 id=\"create-and-configure-ghost-service\">Create and Configure Ghost Service<\/h3>\n<p>After configuring the traefik reverse proxy, we will create the main ghost service configuration.<\/p>\n<p>Configuration details that we want to create.<\/p>\n<ul>\n<li>We will be using the ghost v1 and the small docker alpine version.<\/li>\n<li>We will mount the ghost content directory to the local directory named &#8216;blog&#8217;.<\/li>\n<li>The ghost service will be running on the default port with the domain name &#8216;gho.hakase-labs.io&#8217;, the configuration through docker labels.<\/li>\n<li>The ghost service will be using two docker networks, internal and traefiknet.<\/li>\n<li>We&#8217;re configuring the MySQL database details from the mysql container configuration.<\/li>\n<li>And the ghost will be started when the traefik and MySQL container is up and running.<\/li>\n<\/ul>\n<p>Create a new directory named &#8216;blog&#8217; and edit the &#8216;docker-compose.yml&#8217; file.<\/p>\n<p class=\"command\">mkdir -p blog\/<br \/>vim docker-compose.yml<\/p>\n<p>Paste the configuration below.<\/p>\n<pre readability=\"5\"> ghost:&#13; image: ghost:1-alpine&#13; restart: always&#13; ports:&#13; - 2368&#13; volumes:&#13; - .\/blog:\/var\/lib\/ghost\/content&#13; labels:&#13; - \"traefik.enabled=true\"&#13; - \"traefik.backend=ghost\"&#13; - \"traefik.frontend.rule=Host:gho.hakase-labs.io\"&#13; - \"traefik.docker.network=traefiknet\"&#13; - \"traefik.port=2368\"&#13; networks:&#13; - internal&#13; - traefiknet&#13; environment:&#13; database__client: mysql&#13; database__connection__host: mysql&#13; database__connection__user: ghost&#13; database__connection__password: ghostdbpass&#13; database__connection__database: ghostdb&#13; container_name: ghost&#13; depends_on:&#13; - mysql&#13; - traefik<p>networks:&#13; traefiknet:&#13; external: true&#13; internal:&#13; external: false<\/p><\/pre>\n<p>Save and exit.<\/p>\n<p><a class=\"fancybox\" id=\"img-6\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_deploying_ghost_blog_with_mysql_and_traefik_with_docker\/big\/6.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-5.png\" alt=\"Create and Configure Ghost Service\" width=\"500\" height=\"296\" title=\"\"><\/a><\/p>\n<p>And now we got all directory and configuration as shown below.<\/p>\n<p class=\"command\">tree<\/p>\n<p><a class=\"fancybox\" id=\"img-17\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_deploying_ghost_blog_with_mysql_and_traefik_with_docker\/big\/17.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-6.png\" alt=\"config files\" width=\"500\" height=\"167\" title=\"\"><\/a><\/p>\n<h2 id=\"step-deploy-ghost-with-mysql-and-traefik\">Step 5 &#8211; Deploy Ghost with MySQL and Traefik<\/h2>\n<p>To build and run all our ghost stack service, we can use the command below.<\/p>\n<p class=\"command\">docker-compose up -d<\/p>\n<p><a class=\"fancybox\" id=\"img-18\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_deploying_ghost_blog_with_mysql_and_traefik_with_docker\/big\/18.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-7.png\" alt=\"Deploy Ghost with MySQL and Traefik\" width=\"500\" height=\"519\" title=\"\"><\/a><\/p>\n<p>When it&#8217;s complete, check all running services.<\/p>\n<p class=\"command\">docker-compose ps<\/p>\n<p>And the following is the result.<\/p>\n<p><a class=\"fancybox\" id=\"img-19\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_deploying_ghost_blog_with_mysql_and_traefik_with_docker\/big\/19.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-8.png\" alt=\"docker-compose ps\" width=\"500\" height=\"131\" title=\"\"><\/a><\/p>\n<p>If you have an error, check the container log using commands below.<\/p>\n<p class=\"command\">docker-compose logs mysql<br \/>docker-compose logs traefik<br \/>docker-compose logs ghost<\/p>\n<p><a class=\"fancybox\" id=\"img-20\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_deploying_ghost_blog_with_mysql_and_traefik_with_docker\/big\/20.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-9.png\" alt=\"check the container log\" width=\"500\" height=\"179\" title=\"\"><\/a><\/p>\n<p>The ghost stack with MySQL and the Traefik reverse proxy is up and running.<\/p>\n<h2 id=\"step-testing\">Step 6 &#8211; Testing<\/h2>\n<p>Open the Traefik dashboard with its URL, mine is\u00a0<em><strong>http:\/\/traef.hakase-labs.io\/<\/strong><\/em><\/p>\n<p>Log in with the user and password on the &#8216;traefik.toml&#8217; file.<\/p>\n<p><a class=\"fancybox\" id=\"img-7\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_deploying_ghost_blog_with_mysql_and_traefik_with_docker\/big\/7.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-10.png\" alt=\"Login to Traefik\" width=\"500\" height=\"148\" title=\"\"><\/a><\/p>\n<p>And following is the Traefik dashboard.<\/p>\n<p><a class=\"fancybox\" id=\"img-8\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_deploying_ghost_blog_with_mysql_and_traefik_with_docker\/big\/8.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-11.png\" alt=\"Traefik dashboard\" width=\"500\" height=\"285\" title=\"\"><\/a><\/p>\n<p>For the Ghost installation, type the ghost URL on the address bar, mine is\u00a0<strong>http:\/\/gho.hakase-labs.io\/<\/strong><\/p>\n<p>And you will get the ghost home page.<\/p>\n<p><a class=\"fancybox\" id=\"img-11\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_deploying_ghost_blog_with_mysql_and_traefik_with_docker\/big\/11.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-12.png\" alt=\"Ghost Blog running on Docker\" width=\"500\" height=\"289\" title=\"\"><\/a><\/p>\n<p>Now visit the admin page to set up and configure a new admin user. My URL is:\u00a0http:\/\/gho.hakase-labs.io\/admin\/<\/p>\n<p>Click the green button to create a new admin user.<\/p>\n<p><a class=\"fancybox\" id=\"img-12\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_deploying_ghost_blog_with_mysql_and_traefik_with_docker\/big\/12.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-13.png\" alt=\"Ghost installer\" width=\"500\" height=\"277\" title=\"\"><\/a><\/p>\n<p>Type detail user, password, email, and click again the green button.<\/p>\n<p><a class=\"fancybox\" id=\"img-13\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_deploying_ghost_blog_with_mysql_and_traefik_with_docker\/big\/13.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-14.png\" alt=\"Create admin login\" width=\"500\" height=\"289\" title=\"\"><\/a><\/p>\n<p>For inviting a new member or user, click the &#8216;I will do this later..&#8217; link.<\/p>\n<p><a class=\"fancybox\" id=\"img-14\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_deploying_ghost_blog_with_mysql_and_traefik_with_docker\/big\/14.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-15.png\" alt=\"Invite users\" width=\"500\" height=\"284\" title=\"\"><\/a><\/p>\n<p>Now you will get the Ghost Dashboard.<\/p>\n<p><a class=\"fancybox\" id=\"img-15\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_deploying_ghost_blog_with_mysql_and_traefik_with_docker\/big\/15.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-16.png\" alt=\"Ghost Dashboard\" width=\"500\" height=\"270\" title=\"\"><\/a><\/p>\n<p>And after creating the sample post, the following is the result.<\/p>\n<p><a class=\"fancybox\" id=\"img-16\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_deploying_ghost_blog_with_mysql_and_traefik_with_docker\/big\/16.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-17.png\" alt=\"Ghost glog running in Docker container\" width=\"500\" height=\"289\" title=\"\"><\/a><\/p>\n<p>Ghost blog installation with MySQL database and Traefik Reverse Proxy on the Docker environment has been completed successfully.<\/p>\n<h2 id=\"references\">References<\/h2>\n<div class=\"authorbox\" readability=\"15\">\n<p><strong>About Muhammad Arul<\/strong><\/p>\n<p>Muhammad Arul is a freelance system administrator and technical writer. He is working with Linux Environments for more than 5 years, an Open Source enthusiast and highly motivated on Linux installation and troubleshooting. Mostly working with RedHat\/CentOS Linux and Ubuntu\/Debian, Nginx and Apache web server, Proxmox, Zimbra Administration, and Website Optimization. Currently learning about OpenStack and Container Technology.<\/p>\n<\/div>\n<div>\n<p><b>Share this page:<\/b><\/p>\n<p>\n<a href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fdocker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-18.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fdocker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker%2F&amp;text=Docker+Guide%3A+Deploying+Ghost+Blog+with+MySQL+and+Traefik+with+Docker&amp;via=howtoforgecom&amp;related=howtoforgecom\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-19.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/howtoforgecom\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-20.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/plus.google.com\/share?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fdocker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/docker-guide-deploying-ghost-blog-with-mysql-and-traefik-with-docker-21.png\" height=\"20\" alt=\"\" title=\"\"><\/a>\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Ghost is a powerful open source publishing and blog platform based on nodejs. It&#8217;s well designed and easy to use. The ghost platform is written in JavaScript and uses node.js as a runtime environment. The first Ghost version released in 2013 under the MIT license.. Traefik is modern HTTP reverse proxy and load balancer for &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-6483","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/6483","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=6483"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/6483\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=6483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=6483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=6483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}