Installing Pengin Pi 3 on macOS

This guide covers installing and running Pengin Pi 3 on macOS. Both Apple Silicon (M1/M2/M3/M4) and Intel-based Macs are supported.


Prerequisites

Before starting, ensure you have:

1. Xcode Command Line Tools

Open your Terminal app and install the command-line developer tools:

xcode-select --install

(If a prompt appears, click Install and wait for it to finish).

2. Homebrew

If Homebrew is not already installed on your Mac, run:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Method 1: The Automated Installer (deploy_mac.sh)

Pengin Pi 3 includes a dedicated macOS installer script (deploy_mac.sh) that automates installing Docker Desktop via Homebrew, setting up system requirements, and configuring the container stack.

Important: Do NOT run this script with sudo. Homebrew deliberately refuses to run as root. Run it as your normal user account; the script will prompt for your password only for the specific steps that require elevated permissions.

Steps:

  1. Clone the repository:

    git clone https://code.penginopensource.org/pengin-open-source/pengin-pi-3.git
    cd pengin-pi-3
    
  2. Make the script executable and run it:

    chmod +x deploy_mac.sh
    ./deploy_mac.sh
    
  3. Follow the interactive prompts:

    • The script verifies Homebrew and installs Docker Desktop if it is not already installed.
    • If Docker Desktop was just installed, it launches the app and waits for the Docker engine to initialize.
    • It prompts for the install directory (default /opt/pengin-pi-3), sets up your initial .env file, and hands off to deploy.sh to start the container stack behind Traefik on port 80/443.

Method 2: Lightweight Local Dev Stack (venv)

If you want to run Pengin Pi 3 locally for development without running the full Docker container stack:

  1. Clone the repository and enter the directory:

    git clone https://code.penginopensource.org/pengin-open-source/pengin-pi-3.git
    cd pengin-pi-3
    
  2. Create and activate a virtual environment:

    python3 -m venv .venv
    source .venv/bin/activate
    
  3. Install dependencies:

    pip install -r requirements.txt
    
  4. Prepare local configuration and database:

    cp .env.example .env
    python manage.py migrate
    

    (By default, main/settings.py falls back to a local SQLite database when no external database variables are configured, allowing you to get started immediately).

  5. Start the development server:

    python manage.py runserver
    

Verifying Your Setup

If using the local development server (runserver):

To create your first admin user in the local environment:

python manage.py createsuperuser

If using the Docker deployment (deploy_mac.sh):

The stack runs behind the host reverse proxy on ports 80 (HTTP) and 443 (HTTPS) mapped to your configured domain in .env. Note that the internal web container exposes port 8000 only within Docker networks (expose: - "8000"), not directly to the host.

To create an admin user inside the Docker container:

docker compose exec web python manage.py createsuperuser

macOS Notes & Troubleshooting

  • "Cannot connect to the Docker daemon": Make sure Docker Desktop is running in your macOS menu bar (green icon).
  • Apple Silicon (M1/M2/M3/M4): In Docker Desktop Settings -> General, make sure "Use Rosetta for x86/amd64 emulation on Apple Silicon" is checked for optimal container performance.
  • Port 8000 Conflicts: If port 8000 is occupied by another application (e.g., AirPlay Receiver on macOS Monterey or later), identify it with:
    lsof -i :8000
    
    You can run python manage.py runserver 8080 to serve on an alternate port.

  • Install — Return to the main Installation Guide
  • Deployment — Full docker-compose stack and service details
  • Configuration — Environment variables and .env reference
  • Quickstart — Creating your first slug page and roles