License GitHub stars GitHub issues
Self-hosted WordPress with Caddy and MariaDB on ThreeFold Grid.
Deploy a production-ready WordPress installation with:
- WordPress - Latest official Docker image
- MariaDB - Database backend with health checks
- Caddy - Automatic HTTPS with Let's Encrypt
- Automatic DNS - Optional DNS A record creation (Name.com, Namecheap, Cloudflare)
The easiest way to deploy - answers questions interactively:
tfgrid-compose up tfgrid-wordpress -i
This will prompt you for:
- Domain name
- DNS provider (optional automatic setup)
- WordPress settings
- Resource allocation
- Node selection
Deploy with all settings on the command line:
tfgrid-compose up tfgrid-wordpress \
--env DOMAIN=blog.example.com \
--env SSL_EMAIL=admin@example.com \
--env WP_SITE_TITLE="My Blog" \
--env WP_ADMIN_EMAIL=admin@example.comComplete deployment with DNS automation and all options:
# With Name.com DNS automation (recommended - fully automated) tfgrid-compose up tfgrid-wordpress \ --env DOMAIN=blog.example.com \ --env SSL_EMAIL=admin@example.com \ --env DNS_PROVIDER=name.com \ --env NAMECOM_USERNAME=myuser \ --env NAMECOM_API_TOKEN=your-api-token \ --env WP_SITE_TITLE="My Awesome Blog" \ --env WP_ADMIN_USER=myadmin \ --env WP_ADMIN_EMAIL=admin@example.com \ --env PHP_MEMORY_LIMIT=512M \ --env PHP_UPLOAD_MAX=128M \ --cpu 2 \ --memory 4096 \ --disk 100 # With Cloudflare DNS automation (recommended - fully automated) tfgrid-compose up tfgrid-wordpress \ --env DOMAIN=blog.example.com \ --env DNS_PROVIDER=cloudflare \ --env CLOUDFLARE_API_TOKEN=your-cf-token \ --env WP_SITE_TITLE="My Blog" # With GoDaddy DNS automation tfgrid-compose up tfgrid-wordpress \ --env DOMAIN=blog.example.com \ --env DNS_PROVIDER=godaddy \ --env GODADDY_API_KEY=your-api-key \ --env GODADDY_API_SECRET=your-api-secret \ --env WP_SITE_TITLE="My Blog"
| Variable | Required | Default | Description |
|---|---|---|---|
DOMAIN |
Yes | - | Public domain for WordPress |
SSL_EMAIL |
No | - | Email for Let's Encrypt certificates |
| Variable | Required | Default | Description |
|---|---|---|---|
DNS_PROVIDER |
No | manual |
DNS provider: manual, name.com, cloudflare, godaddy |
NAMECOM_USERNAME |
If name.com | - | Name.com username |
NAMECOM_API_TOKEN |
If name.com | - | Name.com API token |
CLOUDFLARE_API_TOKEN |
If cloudflare | - | Cloudflare API token |
GODADDY_API_KEY |
If godaddy | - | GoDaddy API key |
GODADDY_API_SECRET |
If godaddy | - | GoDaddy API secret |
| Variable | Required | Default | Description |
|---|---|---|---|
WP_ADMIN_USER |
No | admin |
WordPress admin username |
WP_ADMIN_EMAIL |
No | - | WordPress admin email |
WP_SITE_TITLE |
No | My WordPress Site |
Site title |
WP_LOCALE |
No | en_US |
Language/locale code |
| Variable | Required | Default | Description |
|---|---|---|---|
PHP_MEMORY_LIMIT |
No | 256M |
PHP memory limit |
PHP_UPLOAD_MAX |
No | 64M |
Maximum upload file size |
WP_DEBUG |
No | false |
Enable debug mode |
| Variable | Required | Default | Description |
|---|---|---|---|
DB_PASSWORD |
No | auto-generated | MariaDB password |
DB_ROOT_PASSWORD |
No | auto-generated | MariaDB root password |
| Variable | Required | Default | Description |
|---|---|---|---|
BACKUP_RETENTION_DAYS |
No | 30 |
Days to keep backups |
Use -i interactive mode or set DNS_PROVIDER to automatically create DNS A records:
# Interactive - will prompt for credentials tfgrid-compose up tfgrid-wordpress -i # Or specify provider and credentials tfgrid-compose up tfgrid-wordpress \ --env DOMAIN=blog.example.com \ --env DNS_PROVIDER=cloudflare \ --env CLOUDFLARE_API_TOKEN=your-token
If using DNS_PROVIDER=manual (default), you'll need to:
- Deploy the app to get the server IP
- Create an A record with your DNS provider:
- Name:
blog(or@for root domain) - Type:
A - Value:
<server-ip> - TTL:
300
- Name:
- Wait 1-5 minutes for propagation
- Log in to Name.com
- Go to Account → API Token
- Generate a new token
- Log in to Namecheap
- Go to Profile → Tools → API Access
- Enable API access
- Whitelist your current IP (required before API works)
- Copy API Key
Your IP must be whitelisted before running tfgrid-compose up -i. The interactive mode will show your current IP and ask you to confirm it's whitelisted.
- Log in to Cloudflare
- Go to My Profile → API Tokens
- Create token with "Edit zone DNS" permission
| Command | Description |
|---|---|
tfgrid-compose backup |
Create full backup |
tfgrid-compose restore --backup <file> |
Restore from backup |
tfgrid-compose list-backups |
List available backups |
tfgrid-compose logs [service] |
View logs |
tfgrid-compose shell |
Open container shell |
tfgrid-compose wp <command> |
Run WP-CLI commands |
tfgrid-compose restart |
Restart services |
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 1 core | 2 cores |
| Memory | 1 GB | 2 GB |
| Disk | 20 GB | 50 GB |
┌─────────────┐ ┌───────────────┐ ┌──────────────┐
│ Internet │────▶│ Caddy :443 │────▶│ WordPress │
│ │ │ (auto-SSL) │ │ :8080 │
└─────────────┘ └───────────────┘ └──────┬───────┘
│
┌──────▼───────┐
│ MariaDB │
│ :3306 │
└──────────────┘
tfgrid-compose backup
# Output: /opt/wordpress/backups/wordpress_backup_YYYYMMDD_HHMMSS.tar.gztfgrid-compose restore --backup /path/to/backup.tar.gz
- Database dump (SQL)
- WordPress files (wp-content, themes, plugins, uploads)
- Configuration files
tfgrid-compose healthcheck
# All logs tfgrid-compose logs # Specific service tfgrid-compose logs wordpress tfgrid-compose logs db tfgrid-compose logs caddy
WordPress shows "Error establishing database connection"
- Check MariaDB is running:
docker ps - Check database credentials in
.env
SSL certificate not working
- Ensure domain DNS points to server IP
- Check Caddy logs:
tfgrid-compose logs caddy
- 📚 Documentation: docs.tfgrid.studio
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
- 📧 Contact: tfgrid.studio/contact
Apache 2.0