# Self-host WordPress

> The world's most widely used content management system, self-hosted with its own database.

- Page: https://levelrail.com/templates/wordpress/
- JSON: https://levelrail.com/templates/wordpress.json
- Category: Applications
- Licence: GPL-2.0-or-later (Copyleft license)
- Source: https://github.com/WordPress/WordPress
- Upstream docs: https://wordpress.org/documentation/

## Requirements
- Memory: about 512 MiB
- amd64: published, arm64: tested
- Needs configuration before start: no
- Pinned image tag: 8.4

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| db | mysql | 8.4 | none | wordpress_db_data -> /var/lib/mysql |
| wordpress | wordpress | 6.6-apache | 80 | wordpress_data -> /var/www/html |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| db | MYSQL_DATABASE | preset |
| db | MYSQL_PASSWORD | generated |
| db | MYSQL_ROOT_PASSWORD | generated |
| db | MYSQL_USER | preset |
| wordpress | WORDPRESS_DB_HOST | preset |
| wordpress | WORDPRESS_DB_NAME | preset |
| wordpress | WORDPRESS_DB_PASSWORD | generated |
| wordpress | WORDPRESS_DB_USER | preset |

## Deploy

### CLI

```bash
levelrail-cli templates deploy wordpress --name my-wordpress
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/wordpress/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## Questions

### Can I deploy WordPress on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id wordpress for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image mysql:8.4, wordpress:6.6-apache is what you deploy there.

Self-host WordPress, WordPress docker compose file, deploy WordPress on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
