What is Ghost?
Ghost is an open source, professional publishing platform built on a modern Node.js technology stack — designed for teams who need power, flexibility and performance.
Ghost is effectively like WordPress in a lot of ways, but built on Node.js and has a lot of features that would require a whole host of plugins on WordPress built in.
However thats about it for similarities, Ghost is alot harder to get up and running as opposed to WordPress, so this is simply a setup guide on how to get it up and running if you wish to play around or build themes for the Ghost Platform.
This setup is strictly for development use and not for production use
So to get started ensure you have Docker installed and running on your machine.
Basic Setup
Create a new docker-compose.yml file in an empty folder and paste the following:
version: '3.7'
services:
ghost:
image: ghost:latest
restart: always
ports:
- 8040:2368
environment:
NODE_ENV: development
url: http://localhost:8040
volumes:
- ./ghost/content:/var/lib/ghost/content
So quick break down, if all you need to do is get Ghost up and running and do not plan to do any customizations this is all the configuration you need, as Ghost uses SQLite by default so there is no need to add an external database.
However important settings to note:
NODE_ENV - tells Ghost what kind of environment it is setup in, useful when designing themes as it allows you to add and edit custom themes.
url - sets the url that will be used to access ghost
./ghost/content:/var/lib/ghost/content - this is where all the content for the ghost platform is stored, including themes and also if being used SQLite Database.
Advanced Setup
If you want to do a bit more customizing in terms of setup you can instead create a new docker-compose.yml and paste the following:
version: '3.7'
services:
ghost:
image: ghost:latest
restart: always
ports:
- 8041:2368
depends_on:
- ghost-db
environment:
database__client: mysql
database__connection__host: ghost-db
database__connection__database: ghost-dev-db
database__connection__user: ghost-dev-user
database__connection__password: ghost-dev-pass
NODE_ENV: development
url: http://localhost:8041
volumes:
- ./ghost/content:/var/lib/ghost/content
ghost-db:
image: mariadb:latest
restart: always
environment:
MYSQL_DATABASE: ghost-dev-db
MYSQL_USER: ghost-dev-user
MYSQL_PASSWORD: ghost-dev-pass
MYSQL_RANDOM_ROOT_PASSWORD: '1'
volumes:
- ghost-db:/var/lib/mysql
adminer:
image: adminer:latest
restart: unless-stopped
ports:
- 8042:8080
depends_on:
- ghost-db
volumes:
ghost-db:
This configuration uses MariaDB as the database instead of the default SQLite. Which can be accessed using Adminer.
Once everything is up and running, you can head to the http://localhost:8041 url to access ghost, the ghost dashboard can be accessed from http://localhost:8041/ghost.