English
Get started
← All templates

Deploy WordPress on Pethost in one click

A website and blog builder with themes and plugins

What happens

  1. You sign in to Pethost or make an account, with a passkey, GitHub or Google.
  2. No machine yet? You pick a plan, and we prepare one for you. The link waits in your browser until it is ready.
  3. New project opens at the app, and you click Create project.
  4. In a minute or two the app is live at its own address with HTTPS. Its secrets are made for it at random, and its data is in the nightly backup.
  5. It is a project like any other: its compose.yaml, its .env, its logs and a terminal are in the panel, and your agent can change it, roll it back or restore it.

First steps

Open the site and finish the install page: the language, the title and the admin account. Do it right away: whoever opens that page first becomes the admin.

What it runs

The template is this compose.yaml and the variables it writes into the project’s .env. Pethost runs the file as it is written.

services:
  wordpress:
    image: wordpress:7-apache
    restart: unless-stopped
    depends_on:
      db:
        condition: service_healthy
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_NAME: wordpress
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: ${DB_PASSWORD}
    # PHP's own upload limit is 2 MB, too little for a photo or a theme, and the image has no
    # variable for it: the limit is written, then the image's own entrypoint starts as it would.
    entrypoint:
      - sh
      - -c
      - |
        printf 'upload_max_filesize = 64M\npost_max_size = 64M\n' > /usr/local/etc/php/conf.d/uploads.ini
        exec docker-entrypoint.sh apache2-foreground
    volumes:
      - wordpress:/var/www/html

  db:
    image: mariadb:11.8
    restart: unless-stopped
    environment:
      MARIADB_DATABASE: wordpress
      MARIADB_USER: wordpress
      MARIADB_PASSWORD: ${DB_PASSWORD}
      MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
    volumes:
      - db:/var/lib/mysql
    healthcheck:
      test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
      interval: 5s
      timeout: 5s
      retries: 12
      start_period: 60s

volumes:
  wordpress:
  db: