Docker

Pull and run Plainpad using the official Docker image from Docker Hub. Docker allows you to get Plainpad up and running quickly without worrying about server configuration or dependencies.

Prerequisites

  • Docker (v20.10 or newer recommended)
  • Docker Compose (v2.0 or newer, optional)
  • A MySQL database instance

Quick Start

To get started, you'll need a MySQL database. You can start one with Docker and then pull and run Plainpad:

# Start a MySQL instance
docker run -d --name test-db \
  -e MYSQL_ROOT_PASSWORD=secret \
  -e MYSQL_DATABASE=plainpad \
  mysql:latest

# Pull and run the app
docker run -d --name test-app \
  --link test-db:db \
  -p 80:80 \
  -e DB_HOST=db \
  -e DB_NAME=plainpad \
  -e DB_USERNAME=root \
  -e DB_PASSWORD=secret \
  alextselegidis/plainpad:latest

Database Migration

After the application is booted, run the following command to migrate the database:

docker exec -it test-app php artisan migrate:fresh --seed --force

This creates the necessary database tables and an initial admin account you can use to log in.

Docker Compose

You can use the following docker-compose.yml file to set up Plainpad with a MySQL database:

services:
  plainpad:
    image: alextselegidis/plainpad:1.0.0
    ports:
      - '80:80'
    environment:
      - BASE_URL=http://localhost
      - DEBUG_MODE=TRUE
      - DB_HOST=mysql
      - DB_NAME=plainpad
      - DB_USERNAME=root
      - DB_PASSWORD=secret
      - MAIL_PROTOCOL=smtp
      - MAIL_SMTP_DEBUG=0
      - MAIL_SMTP_AUTH=0
      - MAIL_SMTP_USER=
      - MAIL_SMTP_HOST=smtp.example.org
      - MAIL_SMTP_PASS=
      - MAIL_SMTP_CRYPTO=ssl
      - MAIL_SMTP_PORT=465
      - MAIL_FROM_ADDRESS=info@example.org
      - MAIL_FROM_NAME=Example
      - MAIL_REPLY_TO_ADDRESS=info@example.org
  mysql:
    image: mysql:8.0
    environment:
      - MYSQL_ROOT_PASSWORD=secret
      - MYSQL_DATABASE=plainpad

Start the services with:

docker compose up -d

Environment Variables

The Plainpad Docker image supports the following environment variables:

  • BASE_URL — The base URL of your Plainpad instance (e.g. http://localhost)
  • DEBUG_MODE — Enable or disable debug mode (TRUE or FALSE)
  • DB_HOST — Database host
  • DB_NAME — Database name
  • DB_USERNAME — Database username
  • DB_PASSWORD — Database password
  • MAIL_PROTOCOL — Mail protocol (e.g. smtp)
  • MAIL_SMTP_HOST — SMTP server host
  • MAIL_SMTP_PORT — SMTP server port
  • MAIL_SMTP_USER — SMTP username
  • MAIL_SMTP_PASS — SMTP password
  • MAIL_SMTP_CRYPTO — SMTP encryption (e.g. ssl)
  • MAIL_SMTP_AUTH — Enable SMTP authentication (0 or 1)
  • MAIL_SMTP_DEBUG — Enable SMTP debug output (0 or 1)
  • MAIL_FROM_ADDRESS — Sender email address
  • MAIL_FROM_NAME — Sender name
  • MAIL_REPLY_TO_ADDRESS — Reply-to email address

Need Help?

If you run into issues with Docker: