Setup
Overview
This guide will help you set up Ghost on your local machine quickly and efficiently. Ghost uses Docker to orchestrate its ecosystem of services.
Here is a list of the services, and what they do:
frontend: Custom frontend application (React)db: [PostgreSQL] database serverbackend: Custom backend application (Django)rabbitmq: [RabbitMQ] message broker for asynchronous communicationcelery: [Celery] worker for processing background taskscelery-beat: [Celery Beat] scheduler for periodic tasks
Installation
-
Install the system-wide dependencies required to build and run the application with Homebrew
brew install pyenv pyenv-virtualenv nvm -
Configure Python:
Install the current Python version we're using:
pyenv install 3.12.2Create a virtual environment named ghost for the project:
pyenv virtualenv 3.12.2 ghostNavigate to your Ghost project directory and set the local Python version to use the ghost virtual environment:
cd /path/to/ghost/project
pyenv local ghostVerify Python Setup
python --version # Should show Python 3.12.2
which python # Should point to the pyenv-managed PythonSetup the python environment with the tools you need:
pip install pip-tools
cd server
pip install -r requirements.txt -
Configure Node.js: Use nvm to install and use the current Node.js version we're using:
Setup the node environment with the tools you need:
cd app
nvm use
npm install -
Copy over
.env.exampleto.envand fill in the necessary values.cp .env.example .env -
In the
.envfile, setDJANGO_SUPERUSER_EMAILto your email address so you can login to the frontend. -
Follow either (i) Docker or (ii) Local Setup instructions below.
-
Docker Setup (recommended):
Install Docker Desktop and run the following command:
docker-compose up --build -
Local Setup (only as a last resort):
- Start the database:
brew install postgres
brew services start postgresql - Start the backend:
cd server
pyenv activate
python manage.py runserver - Start the frontend:
cd app
npm run dev
- Start the database:
-