This guide assumes you already have a functioning Dokku installation, along with the Dokku MySQL plugin and the Dokku letsencrypt plugin. It also assumes you want to use ghost at the root of a domain.
dokku apps:create ghostblog.com
dokku mysql:create ghostblog
dokku mysql:link ghostblog ghostblog.com
Note that the service name is ghostblog
, the app name is ghostblog.com
dokku config:show ghostblog.com
This will return something like mysql://mysql:[password]@dokku-mysql-ghost:3306/ghostblog
, which you can break apart like so:
dokku config:set ghostblog.com \
database__connection__host=dokku-mysql-ghostblog \
database__connection__user=mysql \
database__connection__password=[password] \
database__connection__database=ghostblog
dokku config:set ghostblog.com NODE_ENV=production url=https://ghostblog.com database__client=mysql
dokku nginx:set ghostblog.com client-max-body-size 50m
dokku proxy:build-config ghostblog.com
mkdir -p /root/ghostblog.com/content
dokku storage:mount ghostblog.com /root/ghostblog.com/content:/var/lib/ghost/content
dokku git:from-image ghostblog.com ghost:latest
dokku ports:set ghostblog.com http:80:2368
dokku letsencrypt:enable ghostblog.com
This assumes you're using sendgrid, but you can configure your own SMTP options below:
dokku config:set ghostblog.com \
mail__transport=SMTP \
mail__from="[email protected]" \
mail__options__service=SMTP \
mail__options__host=smtp.sendgrid.net \
mail__options__port=587 \
mail__options__auth__user=apikey \
mail__options__auth__pass=[password]
Navigate to https://ghostblog.com/ghost and follow the steps.
docker image pull ghost
dokku ps:rebuild ghostblog.com
Ghost Docker image: https://hub.docker.com/_/ghost/
Ghost Email Configuration: https://ghost.org/docs/config/#mail