This setup uses Docker Compose to create a WordPress environment with a MariaDB database and Nginx Proxy Manager for easy HTTPS configuration.
-
Clone the repository:
git clone <your-repository-url> cd <repository-name>
-
Create an
.env
file:Create a
.env
file in the root of the project and set the following environment variables:MYSQL_ROOT_PASSWORD=your_root_password MYSQL_DATABASE=your_database_name MYSQL_USER=your_database_user MYSQL_PASSWORD=your_database_password
Replace the placeholders with your desired values.
-
Create
uploads.ini
file:- Create a file named
uploads.ini
in the root of your project to configure custom PHP upload settings. For example:
file_uploads = On memory_limit = 128M upload_max_filesize = 100M post_max_size = 100M max_execution_time = 600
- Create a file named
-
Start the containers:
docker compose up -d
-
Configure Nginx Proxy Manager:
- Open your web browser and go to
http://localhost:81
. - Log in with the default credentials:
- Email:
[email protected]
- Password:
changeme
- Email:
- Change your default email and password.
- Go to Hosts -> Proxy Hosts.
- Click Add Proxy Host.
- Domain Names:
- Development: Enter a domain name like
your-site.local
. You might need to add this to your/etc/hosts
file pointing to127.0.0.1
. - Production: Enter your actual domain name.
- Development: Enter a domain name like
- Forward Hostname / IP:
wordpress
- Forward Port:
80
- SSL Tab:
- Development: You can choose "Request a new SSL certificate with Let's Encrypt" for a self-signed certificate or "None" to use HTTP.
- Production: Choose "Request a new SSL certificate with Let's Encrypt".
- Enable "Force SSL" and other security options as needed.
- Enter your email address.
- Click "Save."
- Open your web browser and go to
-
Access WordPress:
- Development:
http://your-site.local
(orhttps://your-site.local
if you set up a self-signed certificate). - Production:
https://your-domain.com
You should now be able to access the WordPress installation wizard.
- Development:
- Tailwind CSS: https://tailwindcss.com/
- Shadcn UI: https://ui.shadcn.com/
- If you are using this setup for local development, you might need to add
your-site.local
(or your chosen domain name) to your computer's/etc/hosts
file, pointing it to127.0.0.1
. - For production, make sure your DNS records are configured to point your domain name to your server's IP address.
--
. ├── db_data/ ├── nginx_proxy_manager/ │ ├── data/ │ └── letsencrypt/ ├── wordpress/ ├── .env ├── docker-compose.yml ├── README.md └── uploads.ini