Skip to main content

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 server
  • backend: Custom backend application (Django)
  • rabbitmq: [RabbitMQ] message broker for asynchronous communication
  • celery: [Celery] worker for processing background tasks
  • celery-beat: [Celery Beat] scheduler for periodic tasks

Installation

  1. Install the system-wide dependencies required to build and run the application with Homebrew

    brew install pyenv pyenv-virtualenv nvm
  2. Configure Python:

    Install the current Python version we're using:

    pyenv install 3.12.2

    Create a virtual environment named ghost for the project:

    pyenv virtualenv 3.12.2 ghost

    Navigate to your Ghost project directory and set the local Python version to use the ghost virtual environment:

    cd /path/to/ghost/project
    pyenv local ghost

    Verify Python Setup

    python --version  # Should show Python 3.12.2
    which python # Should point to the pyenv-managed Python

    Setup the python environment with the tools you need:

    pip install pip-tools
    cd server
    pip install -r requirements.txt
  3. 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
  4. Copy over .env.example to .env and fill in the necessary values.

    cp .env.example .env
  5. In the .env file, set DJANGO_SUPERUSER_EMAIL to your email address so you can login to the frontend.

  6. Follow either (i) Docker or (ii) Local Setup instructions below.

    1. Docker Setup (recommended):

      Install Docker Desktop and run the following command:

      docker-compose up --build
    2. Local Setup (only as a last resort):

      1. Start the database:
        brew install postgres
        brew services start postgresql
      2. Start the backend:
        cd server
        pyenv activate
        python manage.py runserver
      3. Start the frontend:
        cd app
        npm run dev